Skip to content

Commit

Permalink
Add test for new function
Browse files Browse the repository at this point in the history
  • Loading branch information
dyceron committed Dec 15, 2024
1 parent 3dcae8c commit ce0d43d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/formats/test_bmsmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,25 @@
from tests.test_lib import parse_build_compare_editor

from mercury_engine_data_structures import samus_returns_data
from mercury_engine_data_structures.formats.bmsmsd import Bmsmsd
from mercury_engine_data_structures.formats.bmsmsd import Bmsmsd, TileType


@pytest.mark.parametrize("bmsmsd_path", samus_returns_data.all_files_ending_with(".bmsmsd"))
def test_bmsmsd(samus_returns_tree, bmsmsd_path):
parse_build_compare_editor(Bmsmsd, samus_returns_tree, bmsmsd_path)

@pytest.fixture()
def surface_bmsmsd(samus_returns_tree) -> Bmsmsd:
return samus_returns_tree.get_parsed_asset(
"maps/levels/c10_samus/s000_surface/s000_surface.bmsmsd", type_hint=Bmsmsd
)

def test_get_tile(surface_bmsmsd: Bmsmsd):
tile = surface_bmsmsd.get_tile(4)
assert tile.tile_coordinates == [48, 5]

tile = surface_bmsmsd.get_tile(12)
assert len(tile.icons) == 2

tile = surface_bmsmsd.get_tile(25)
assert tile.tile_type == TileType.NORMAL

0 comments on commit ce0d43d

Please sign in to comment.