Skip to content

Commit

Permalink
fix: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MDavidson17 committed Dec 8, 2023
1 parent bfbf272 commit 2c4c7cf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions scripts/stac/tests/generate_description_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@

def test_generate_description_imagery() -> None:
description = "Orthophotography within the Auckland region captured in the 2023 flying season."
generated_description = generate_description("Rural Aerial Photos", "Auckland", datetime(2023, 1, 1), datetime(2023, 2, 2))
generated_description = generate_description("Rural Aerial Photos", "auckland", datetime(2023, 1, 1), datetime(2023, 2, 2))
assert generated_description == description


def test_generate_description_elevation() -> None:
description = "Digital Elevation Model within the Auckland region in 2023."
generated_description = generate_description("DEM", "Auckland", datetime(2023, 1, 1), datetime(2023, 2, 2))
generated_description = generate_description("DEM", "auckland", datetime(2023, 1, 1), datetime(2023, 2, 2))
assert generated_description == description


def test_generate_description_elevation_location_input() -> None:
description = "Digital Elevation Model within the Auckland - Central region in 2023."
generated_description = generate_description(
"DEM", "Auckland", datetime(2023, 1, 1), datetime(2023, 2, 2), location="Central"
"DEM", "auckland", datetime(2023, 1, 1), datetime(2023, 2, 2), location="Central"
)
assert generated_description == description


def test_generate_description_satellite_imagery() -> None:
description = "Satellite imagery within the Auckland region captured in 2023."
generated_description = generate_description("Satellite Imagery", "Auckland", datetime(2023, 1, 1), datetime(2023, 2, 2))
generated_description = generate_description("Satellite Imagery", "auckland", datetime(2023, 1, 1), datetime(2023, 2, 2))
assert generated_description == description


def test_generate_description_historic_imagery() -> None:
description = "Scanned aerial imagery within the Auckland region captured in 2000."
generated_description = generate_description(
"Aerial Photos", "Auckland", datetime(2000, 1, 1), datetime(2000, 2, 2), historic_survey_number="SNC8844"
"Aerial Photos", "auckland", datetime(2000, 1, 1), datetime(2000, 2, 2), historic_survey_number="SNC8844"
)
assert generated_description == description

Expand All @@ -41,6 +41,6 @@ def test_generate_description_event() -> None:
description = "Orthophotography within the Hawke's Bay region captured in the 2023 flying season, \
published as a record of the Cyclone Gabrielle event."
generated_description = generate_description(
"Rural Aerial Photos", "Hawke's Bay", datetime(2023, 1, 1), datetime(2023, 2, 2), event="Cyclone Gabrielle"
"Rural Aerial Photos", "hawkes-bay", datetime(2023, 1, 1), datetime(2023, 2, 2), event="Cyclone Gabrielle"
)
assert generated_description == description
24 changes: 12 additions & 12 deletions scripts/stac/tests/generate_title_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@
def test_generate_imagery_title() -> None:
title = "Auckland 0.3m Rural Aerial Photos (2023)"
generated_title = generate_title(
"Rural Aerial Photos", "Auckland", "0.3m", datetime(2023, 1, 1), datetime(2023, 2, 2), "completed"
"Rural Aerial Photos", "auckland", "0.3m", datetime(2023, 1, 1), datetime(2023, 2, 2), "completed"
)
assert generated_title == title


def test_generate_dem_title() -> None:
title = "Auckland LiDAR 0.3m DEM (2023)"
generated_title = generate_title("DEM", "Auckland", "0.3m", datetime(2023, 1, 1), datetime(2023, 2, 2), "completed")
generated_title = generate_title("DEM", "auckland", "0.3m", datetime(2023, 1, 1), datetime(2023, 2, 2), "completed")
assert generated_title == title


def test_generate_dsm_title() -> None:
title = "Auckland LiDAR 0.3m DSM (2023)"
generated_title = generate_title("DSM", "Auckland", "0.3m", datetime(2023, 1, 1), datetime(2023, 2, 2), "completed")
generated_title = generate_title("DSM", "auckland", "0.3m", datetime(2023, 1, 1), datetime(2023, 2, 2), "completed")
assert generated_title == title


def test_generate_satellite_imagery_title() -> None:
title = "Auckland 0.5m Satellite Imagery (2023)"
generated_title = generate_title(
"Satellite Imagery", "Auckland", "0.5m", datetime(2023, 1, 1), datetime(2023, 2, 2), "completed"
"Satellite Imagery", "auckland", "0.5m", datetime(2023, 1, 1), datetime(2023, 2, 2), "completed"
)
assert generated_title == title

Expand All @@ -35,7 +35,7 @@ def test_generate_historic_imagery_title() -> None:
title = "Auckland 0.3m SNC8844 (2000)"
generated_title = generate_title(
"Aerial Photos",
"Auckland",
"auckland",
"0.3m",
datetime(2000, 1, 1),
datetime(2000, 2, 2),
Expand All @@ -48,7 +48,7 @@ def test_generate_historic_imagery_title() -> None:
def test_generate_title_long_date() -> None:
title = "Auckland 0.3m Urban Aerial Photos (2023 - 2024)"
generated_title = generate_title(
"Urban Aerial Photos", "Auckland", "0.3m", datetime(2023, 1, 1), datetime(2024, 2, 2), "completed"
"Urban Aerial Photos", "auckland", "0.3m", datetime(2023, 1, 1), datetime(2024, 2, 2), "completed"
)
assert generated_title == title

Expand All @@ -57,7 +57,7 @@ def test_generate_title_location() -> None:
title = "Banks Penninsula 0.3m Rural Aerial Photos (2023)"
generated_title = generate_title(
"Rural Aerial Photos",
"Canterbury",
"canterbury",
"0.3m",
datetime(2023, 1, 1),
datetime(2023, 2, 2),
Expand All @@ -71,7 +71,7 @@ def test_generate_title_event_imagery() -> None:
title = "Hawke's Bay 0.3m Cyclone Gabrielle Rural Aerial Photos (2023)"
generated_title = generate_title(
"Rural Aerial Photos",
"Hawke's Bay",
"hawkes-bay",
"0.3m",
datetime(2023, 1, 1),
datetime(2023, 2, 2),
Expand All @@ -84,7 +84,7 @@ def test_generate_title_event_imagery() -> None:
def test_generate_title_event_elevation() -> None:
title = "Hawke's Bay - Cyclone Gabrielle LiDAR 0.3m DSM (2023)"
generated_title = generate_title(
"DSM", "Hawke's Bay", "0.3m", datetime(2023, 1, 1), datetime(2023, 2, 2), "completed", event="Cyclone Gabrielle"
"DSM", "hawkes-bay", "0.3m", datetime(2023, 1, 1), datetime(2023, 2, 2), "completed", event="Cyclone Gabrielle"
)
assert generated_title == title

Expand All @@ -93,7 +93,7 @@ def test_generate_title_event_satellite_imagery() -> None:
title = "Hawke's Bay 0.5m Cyclone Gabrielle Satellite Imagery (2023)"
generated_title = generate_title(
"Satellite Imagery",
"Hawke's Bay",
"hawkes-bay",
"0.5m",
datetime(2023, 1, 1),
datetime(2023, 2, 2),
Expand All @@ -105,15 +105,15 @@ def test_generate_title_event_satellite_imagery() -> None:

def test_generate_dsm_title_preview() -> None:
title = "Auckland LiDAR 0.3m DSM (2023) - preview"
generated_title = generate_title("DSM", "Auckland", "0.3m", datetime(2023, 1, 1), datetime(2023, 2, 2), "preview")
generated_title = generate_title("DSM", "auckland", "0.3m", datetime(2023, 1, 1), datetime(2023, 2, 2), "preview")
assert generated_title == title


def test_generate_imagery_title_empty_optional_str() -> None:
title = "Auckland 0.3m Rural Aerial Photos (2023)"
generated_title = generate_title(
"Rural Aerial Photos",
"Auckland",
"auckland",
"0.3m",
datetime(2023, 1, 1),
datetime(2023, 2, 2),
Expand Down

0 comments on commit 2c4c7cf

Please sign in to comment.