def test_swap_swaps_two_tiles(): output_sheet = [[2, 1]] test_map = Map([[1, 2]], [[1, 2]], [[1, 2]], [[1, 2]], validate=False) test_map.swap((0, 0), (1, 0), Map.FOREGROUND_SHEET_INDEX) test_map.swap((0, 0), (1, 0), Map.CHARACTER_SHEET_INDEX) test_map.swap((0, 0), (1, 0), Map.PATH_SHEET_INDEX) test_map.swap((0, 0), (1, 0), Map.BACKGROUND_SHEET_INDEX) assert test_map.tile_sheets == ( list(output_sheet), list(output_sheet), list(output_sheet), list(output_sheet), )
def test_swap_done_on_sheet_greater_than_3_raises_value_error(): test_map = Map([[1, 2]], [[1, 2]], [[1, 2]], [[1, 2]], validate=False) with pytest.raises(ValueError): test_map.swap((0, 1), (0, 1), Map.BACKGROUND_SHEET_INDEX + 1)
def test_swap_done_on_sheet_less_than_0_raises_value_error(): test_map = Map([[1, 2]], [[1, 2]], [[1, 2]], [[1, 2]], validate=False) with pytest.raises(ValueError): test_map.swap((0, 1), (0, 1), Map.FOREGROUND_SHEET_INDEX - 1)