Esempio n. 1
0
 def test_instantiation_from_invalid__with_wrong_argnumber(self):
     str_pos = '1 2'  # x, y, and direction
     position_from_string = Position.from_string(str_pos)
Esempio n. 2
0
 def test_instantiation_from_invalid_string_with_wrong_xy(self):
     str_pos = 'someRandomInt 2 n'  # x, y, and direction
     position_from_string = Position.from_string(str_pos)
Esempio n. 3
0
 def test_instantiation_from_invalid_string_with_wrong_direction(self):
     str_pos = '1 2 someInvalidCharacter'  # x, y, and direction
     position_from_string = Position.from_string(str_pos)
Esempio n. 4
0
 def test_instantiation_from_valid_string(self):
     pos = Position(x=1, y=2, direction='n')
     str_pos = '1 2 n'  # x, y, and direction
     position_from_string = Position.from_string(str_pos)
     self.assertEqual(pos, position_from_string)