Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Sullivan committed Feb 7, 2024
1 parent 09a102d commit ad5f987
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ def test_du(tmp_path):


def test_tile_name():
assert cache.tile_name("abc", 1, 2, 3, "somehash") == "abc/somehash/3/1/2.png"
assert cache.tile_name("abc", 1, 2, 3, "somehash") == "ba7816bf8f01cfea4141/somehash/3/1/2.png"


def test_tile_id():
assert cache.tile_id("abc", 1, 2, 3, "somehash") == "abc_somehash_3_1_2"
assert cache.tile_id("abc", 1, 2, 3, "somehash") == "ba7816bf8f01cfea4141_somehash_3_1_2"


def test_get_cache_none():
Expand All @@ -57,8 +57,8 @@ def test_set_cache(tmp_path):


def test_check_cache_dir(tmp_path):
cache.check_cache_dir(tmp_path, "foo")
assert (tmp_path / "foo").exists()
cache.check_cache_dir(tmp_path, "abc")
assert (tmp_path / "ba7816bf8f01cfea4141").exists()


def test_clear_hash_cache(tmp_path):
Expand Down
8 changes: 4 additions & 4 deletions tests/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ def test_get_category_field():
assert parameters.get_category_field(None) is None
assert parameters.get_category_field("banana") == "banana"

def test_get_parameter_hash():
assert parameters.get_parameter_hash({"foo": "bar", "baz": 1}) == "a6488297eb1cdaa23e196800b1c399b13d9a5c86cfecaf8f9fd0fbe9af7533db"
assert parameters.get_parameter_hash({"foo": "bar", "baz": 1, "abc": datetime(2022, 2, 17, 11, 0, 0, tzinfo=timezone.utc)}) == "88ade56886a8099e6fd3c25525a0fb9ab3938be64374569480ed3bfd7f3d70e9"
assert parameters.get_parameter_hash({}) == "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
def test_get_parameter_hash():a6488297eb1cdaa23e196800b1c399
assert parameters.get_parameter_hash({"foo": "bar", "baz": 1}) == "a6488297eb1cdaa23e196800b1c399"
assert parameters.get_parameter_hash({"foo": "bar", "baz": 1, "abc": datetime(2022, 2, 17, 11, 0, 0, tzinfo=timezone.utc)}) == "88ade56886a8099e6fd3c25525a0fb"
assert parameters.get_parameter_hash({}) == "e3b0c44298fc1c149afbf4c8996fb9"

def test_get_time_bounds_already_quantized():
now = datetime(2022, 6, 14, 12, 15, 0, tzinfo=timezone.utc)
Expand Down

0 comments on commit ad5f987

Please sign in to comment.