def test_fleet_setter(): ship1 = Ship(4, [(3, 2), (3, 3), (3, 4), (3, 5)], 'poziom') ship2 = Ship(3, [(2, 6), (3, 6)], 'pion') fleet = Fleet([ship1, ship2]) ship3 = Ship(3, [(5, 2), (5, 3), (5, 4)], 'poziom') ship4 = Ship(2, [(2, 6), (2, 7)], 'poziom') fleet.set_ships_list([ship3, ship4]) assert fleet.get_ships_list() == [ship3, ship4]
def test_fleet_remove_ship_from_fleet(): ship1 = Ship(4, [(3, 2), (3, 3), (3, 4), (3, 5)], 'poziom') ship2 = Ship(3, [(2, 6), (3, 6)], 'pion') fleet = Fleet([ship1, ship2]) fleet.remove_ship_from_fleet(ship2) assert fleet.get_ships_list() == [ship1]
def test_fleet_getter(): ship1 = Ship(4, [(3, 2), (3, 3), (3, 4), (3, 5)], 'poziom') ship2 = Ship(3, [(2, 6), (3, 6)], 'pion') fleet = Fleet([ship1, ship2]) assert fleet.get_ships_list() == [ship1, ship2]