Skip to content

Commit

Permalink
Fixed tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Jelbart authored and jeremyh committed Jun 8, 2021
1 parent 49973b6 commit e26245e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/integration/prepare/test_prepare_landsat_l1.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,26 @@
Path(__file__).parent.parent / "data" / "LE07_L2SP_090084_20210331_20210426_02_T1"
)


@pytest.fixture
def lc08_l2_c2_post_20210507_folder(tmp_path: Path) -> Path:
return _make_copy(LC08_L2_C2_POST_20210507_INPUT_PATH, tmp_path)


@pytest.fixture
def lt05_l2_c2_folder(tmp_path: Path) -> Path:
return _make_copy(LT05_L2_C2_INPUT_PATH, tmp_path)


@pytest.fixture
def le07_l2_c2_folder(tmp_path: Path) -> Path:
return _make_copy(LE07_L2_C2_INPUT_PATH, tmp_path)


def relative_offset(base, offset):
return offset


def _make_copy(input_path, tmp_path):
our_input = tmp_path / input_path.name
if input_path.is_file():
Expand All @@ -44,6 +49,7 @@ def _make_copy(input_path, tmp_path):
shutil.copytree(input_path, our_input)
return our_input


def test_prepare_l5_l1_usgs_tarball(
tmp_path: Path, l1_ls5_tarball_md_expected: Dict, l1_ls5_tarball: Path
):
Expand Down Expand Up @@ -282,7 +288,7 @@ def test_skips_old_datasets(l1_ls7_tarball):

def expected_lc08_l2_c2_post_20210507_folder(
l2_c2_ls8_folder=lc08_l2_c2_post_20210507_folder,
offset: Callable[[Path, str], str]=relative_offset,
offset: Callable[[Path, str], str] = relative_offset,
organisation="usgs.gov",
collection="2",
leveln_collection="2",
Expand Down Expand Up @@ -449,7 +455,7 @@ def expected_lc08_l2_c2_post_20210507_folder(

def expected_lt05_l2_c2_folder(
l2_c2_ls8_folder=lt05_l2_c2_folder,
offset: Callable[[Path, str], str]=relative_offset,
offset: Callable[[Path, str], str] = relative_offset,
organisation="usgs.gov",
collection="2",
leveln_collection="2",
Expand Down Expand Up @@ -612,7 +618,7 @@ def expected_lt05_l2_c2_folder(

def expected_le07_l2_c2_folder(
l2_c2_ls8_folder=le07_l2_c2_folder,
offset: Callable[[Path, str], str]=relative_offset,
offset: Callable[[Path, str], str] = relative_offset,
organisation="usgs.gov",
collection="2",
leveln_collection="2",
Expand Down

0 comments on commit e26245e

Please sign in to comment.