test:fix: properly read tileset

This commit is contained in:
Benjamin Kirkbride
2020-06-04 21:30:48 -04:00
parent db33e6bc67
commit 20eb9a4a59

View File

@@ -18,8 +18,6 @@ ALL_TILESET_DIRS = TILE_SETS.glob("*")
@pytest.mark.parametrize("tileset_dir", ALL_TILESET_DIRS)
def test_tilesets_integration(tileset_dir):
""" This could be redundant, but it is useful just to ensure that anything in there
is at least sanity checked"""
# it's a PITA to import like this, don't do it
# https://stackoverflow.com/a/67692/1342874
spec = importlib.util.spec_from_file_location(
@@ -31,6 +29,6 @@ def test_tilesets_integration(tileset_dir):
raw_tileset_path = tileset_dir / "tileset.json"
with open(raw_tileset_path) as raw_tileset:
tileset_ = tileset.cast(json.loads(raw_tileset))
tileset_ = tileset.cast(json.loads(raw_tileset.read()))
assert tileset_ == expected.EXPECTED