def test_starts_too_far_north(self):
     ship = Ship(
         x=4,
         y=-1,
         length=4,
         direction=Ship.CARDINAL_DIRECTIONS['SOUTH']
     )
     self.assertFalse(is_valid_ship_position(ship))
 def test_valid_position(self):
     ship = Ship(
         x=2,
         y=4,
         length=4,
         direction=Ship.CARDINAL_DIRECTIONS['EAST']
     )
     self.assertTrue(is_valid_ship_position(ship))
 def test_ends_too_far_east(self):
     ship = Ship(
         x=8,
         y=5,
         length=4,
         direction=Ship.CARDINAL_DIRECTIONS['EAST']
     )
     self.assertFalse(is_valid_ship_position(ship))
Exemple #4
0
 def test_starts_too_far_south(self):
     ship = Ship(x=4,
                 y=10,
                 length=4,
                 direction=Ship.CARDINAL_DIRECTIONS['NORTH'])
     self.assertFalse(is_valid_ship_position(ship))
Exemple #5
0
 def test_valid_position(self):
     ship = Ship(x=2,
                 y=4,
                 length=4,
                 direction=Ship.CARDINAL_DIRECTIONS['EAST'])
     self.assertTrue(is_valid_ship_position(ship))
Exemple #6
0
 def test_ends_too_far_east(self):
     ship = Ship(x=8,
                 y=5,
                 length=4,
                 direction=Ship.CARDINAL_DIRECTIONS['EAST'])
     self.assertFalse(is_valid_ship_position(ship))