def test_water_edge_is_not_buildable(): board = Board() top_left_north_edge = 45 board.build_settlement(Color.RED, top_left_north_edge, initial_build_phase=True) buildable = board.buildable_edges(Color.RED) assert len(buildable) == 2
def test_enemy_edge_not_buildable(): board = Board() board.build_settlement(Color.BLUE, 0, initial_build_phase=True) board.build_road(Color.BLUE, (0, 1)) board.build_settlement(Color.RED, 2, initial_build_phase=True) board.build_road(Color.RED, (2, 1)) buildable_edges = board.buildable_edges(Color.RED) assert len(buildable_edges) == 3
def test_buildable_edges(): board = Board() board.build_settlement(Color.RED, 3, initial_build_phase=True) board.build_road(Color.RED, (3, 4)) buildable = board.buildable_edges(Color.RED) assert len(buildable) == 4
def test_buildable_edges_in_mini(): board = Board(catan_map=CatanMap(MINI_MAP_TEMPLATE)) board.build_settlement(Color.RED, 19, initial_build_phase=True) buildable = board.buildable_edges(Color.RED) assert len(buildable) == 2