From 53d7cca47e67487c26dbbf663aa9ef0bfd7c301f Mon Sep 17 00:00:00 2001 From: Darren Eberly Date: Wed, 19 Aug 2020 23:03:31 -0400 Subject: [PATCH] refactor(map): Renamed `map` to `tiled_map` to avoid redefining the built-in --- pytiled_parser/__init__.py | 2 +- pytiled_parser/{map.py => tiled_map.py} | 0 tests/test_data/map_tests/embedded_tileset/expected.py | 4 ++-- tests/test_data/map_tests/hexagonal/expected.py | 4 ++-- tests/test_data/map_tests/no_background_color/expected.py | 4 ++-- tests/test_data/map_tests/no_layers/expected.py | 4 ++-- tests/test_map.py | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) rename pytiled_parser/{map.py => tiled_map.py} (100%) diff --git a/pytiled_parser/__init__.py b/pytiled_parser/__init__.py index 3ed056d..258acdd 100644 --- a/pytiled_parser/__init__.py +++ b/pytiled_parser/__init__.py @@ -4,6 +4,6 @@ from .common_types import OrderedPair, Size from .layer import Layer -from .map import Map from .properties import Properties +from .tiled_map import Map from .tileset import TileSet diff --git a/pytiled_parser/map.py b/pytiled_parser/tiled_map.py similarity index 100% rename from pytiled_parser/map.py rename to pytiled_parser/tiled_map.py diff --git a/tests/test_data/map_tests/embedded_tileset/expected.py b/tests/test_data/map_tests/embedded_tileset/expected.py index ffc69c7..ebaaddc 100644 --- a/tests/test_data/map_tests/embedded_tileset/expected.py +++ b/tests/test_data/map_tests/embedded_tileset/expected.py @@ -1,8 +1,8 @@ from pathlib import Path -from pytiled_parser import common_types, map, tileset +from pytiled_parser import common_types, tiled_map, tileset -EXPECTED = map.Map( +EXPECTED = tiled_map.Map( infinite=False, layers=[], map_size=common_types.Size(8, 6), diff --git a/tests/test_data/map_tests/hexagonal/expected.py b/tests/test_data/map_tests/hexagonal/expected.py index a3daadc..3bf032e 100644 --- a/tests/test_data/map_tests/hexagonal/expected.py +++ b/tests/test_data/map_tests/hexagonal/expected.py @@ -1,8 +1,8 @@ from pathlib import Path -from pytiled_parser import common_types, layer, map, tileset +from pytiled_parser import common_types, layer, tiled_map, tileset -EXPECTED = map.Map( +EXPECTED = tiled_map.Map( hex_side_length=6, stagger_axis="y", stagger_index="odd", diff --git a/tests/test_data/map_tests/no_background_color/expected.py b/tests/test_data/map_tests/no_background_color/expected.py index 6e2de52..1df8bc2 100644 --- a/tests/test_data/map_tests/no_background_color/expected.py +++ b/tests/test_data/map_tests/no_background_color/expected.py @@ -1,8 +1,8 @@ from pathlib import Path -from pytiled_parser import common_types, map, tileset +from pytiled_parser import common_types, tiled_map, tileset -EXPECTED = map.Map( +EXPECTED = tiled_map.Map( infinite=False, layers=[], map_size=common_types.Size(8, 6), diff --git a/tests/test_data/map_tests/no_layers/expected.py b/tests/test_data/map_tests/no_layers/expected.py index b719a60..bd7a222 100644 --- a/tests/test_data/map_tests/no_layers/expected.py +++ b/tests/test_data/map_tests/no_layers/expected.py @@ -1,8 +1,8 @@ from pathlib import Path -from pytiled_parser import common_types, map, tileset +from pytiled_parser import common_types, tiled_map, tileset -EXPECTED = map.Map( +EXPECTED = tiled_map.Map( infinite=False, layers=[], map_size=common_types.Size(8, 6), diff --git a/tests/test_map.py b/tests/test_map.py index d841e09..50363c1 100644 --- a/tests/test_map.py +++ b/tests/test_map.py @@ -5,7 +5,7 @@ from pathlib import Path import pytest -from pytiled_parser import map as map_ +from pytiled_parser import tiled_map TESTS_DIR = Path(os.path.dirname(os.path.abspath(__file__))) TEST_DATA = TESTS_DIR / "test_data" @@ -29,6 +29,6 @@ def test_map_integration(map_test): raw_maps_path = map_test / "map.json" - casted_map = map_.cast(raw_maps_path) + casted_map = tiled_map.cast(raw_maps_path) assert casted_map == expected.EXPECTED