загружаю начало 17 занятия

This commit is contained in:
ehermakov 2024-03-14 22:06:56 +03:00
parent a0050ef3f0
commit 2ff4eceea1
2 changed files with 23 additions and 3 deletions

View File

@ -127,11 +127,31 @@ class TestShipField(TestCase):
ship_field = ShipField() # Заводим объект типа ShipField
ship_field.set_ship_direction(1)
self.assertEqual(ship_field.ship_direction, 1)
ship_field.set_ship_direction(0)
self.assertEqual(ship_field.ship_direction, 0)
def test_set_ship_direction_outofrange(self):
ship_field = ShipField() # Заводим объект типа ShipField
ship_field.set_ship_direction(1)
ship_field.set_ship_direction(-1)
ship_field.set_ship_direction(2)
self.assertEqual(ship_field.ship_direction, 1)
def test_set_ship_direction_wrongtype(self):
ship_field = ShipField() # Заводим объект типа ShipField
ship_field.set_ship_direction(1)
ship_field.set_ship_direction(None)
ship_field.set_ship_direction([2])
ship_field.set_ship_direction({})
self.assertEqual(ship_field.ship_direction, 1)
def test_toggle_ship_direction(self):
self.fail()
#arrangement установка
# action действие
#assertion проверка
ship_field = ShipField()
ship_field.toggle_ship_direction()
self.assertEqual(ship_field.ship_direction, 1)