Skip to content

Commit

Permalink
try differerent cache dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
scottstanie committed Oct 31, 2023
1 parent dd6ef1d commit 68b593c
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions eof/tests/test_asf_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ def test_asf_client():
ASFClient()


@pytest.mark.vcr
def test_asf_client_download(tmp_path):
cache_dir = tmp_path / "sentineleof"
cache_dir.mkdir()

dt = datetime.datetime(2020, 1, 1)
mission = "S1A"
asfclient = ASFClient(cache_dir=(tmp_path / "sentineleof"))
urls = asfclient.get_download_urls([dt], [mission], orbit_type="precise")
expected = "https://s1qc.asf.alaska.edu/aux_poeorb/S1A_OPER_AUX_POEORB_OPOD_20210315T155112_V20191230T225942_20200101T005942.EOF" # noqa
assert urls == [expected]


@pytest.mark.vcr
def test_asf_full_url_list(tmp_path):
cache_dir = tmp_path / "sentineleof"
cache_dir = tmp_path / "sentineleof1"
cache_dir.mkdir()
asfclient = ASFClient(cache_dir=cache_dir)

asfclient = ASFClient(cache_dir=(tmp_path / "sentineleof"))
urls = asfclient.get_full_eof_list()
assert len(urls) > 0
assert (cache_dir / "precise_filenames.txt").exists()
# Should be quick second time
assert len(asfclient.get_full_eof_list())


@pytest.mark.vcr
def test_asf_client_download(tmp_path):
cache_dir = tmp_path / "sentineleof2"
cache_dir.mkdir()
asfclient = ASFClient(cache_dir=cache_dir)

dt = datetime.datetime(2020, 1, 1)
mission = "S1A"
urls = asfclient.get_download_urls([dt], [mission], orbit_type="precise")
expected = "https://s1qc.asf.alaska.edu/aux_poeorb/S1A_OPER_AUX_POEORB_OPOD_20210315T155112_V20191230T225942_20200101T005942.EOF" # noqa
assert urls == [expected]

0 comments on commit 68b593c

Please sign in to comment.