Skip to content

Commit

Permalink
refactor: randomize fake linz slug and deduplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidtnz committed Nov 5, 2024
1 parent 708dd3e commit 4459069
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
12 changes: 12 additions & 0 deletions scripts/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pytest
from random import choice, randint
from string import ascii_lowercase

@pytest.fixture
def fake_linz_slug() -> str:
random_string = "".join(choice(ascii_lowercase) for _ in range(6))
start_year = randint(2000,2009)
end_year = randint(2010,2019)
gsd = choice([0.75, 0.3, 1, 0.075])

return f"a-random-slug-{random_string}_{start_year}-{end_year}_{gsd}m"
5 changes: 0 additions & 5 deletions scripts/stac/imagery/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,3 @@ def fake_collection_metadata() -> Iterator[CollectionMetadata]:
"geographic_description": None,
}
yield collection_metadata


@pytest.fixture
def fake_linz_slug() -> str:
return "somewhere-in-new-zealand_2021-2023_0.75m"
6 changes: 0 additions & 6 deletions scripts/tests/conftest.py

This file was deleted.

0 comments on commit 4459069

Please sign in to comment.