示例#1
0
 def test_must_alternate2(self):
     path = [DummyState(0),
             get_action((0, 0), (0, 0)),  # Catchall action
             get_action((0, 0), (0, 0)),
             DummyState(0),
             ]
     self.assertFalse(check_path(path))
示例#2
0
 def test_must_alternate(self):
     path = [DummyState(0),
             DummyState(0),
             get_action((0, 0), (0, 0)),  # Catchall action
             DummyState(0),
             ]
     self.assertFalse(check_path(path))
示例#3
0
 def test_path_is_valid(self):
     path = [DummyState(0),
             get_action((1, 0), (1, 1)),
             DummyState(1 + 4),
             get_action((1 + 2, 1), (1 + 2, 1 + 2)),
             DummyState(1 + 2 + 4),
             ]
     self.assertTrue(check_path(path))
示例#4
0
 def test_must_validate_post_condition2(self):
     path = [DummyState(1),
             get_action((0, 0), (0, 0)),  # Catchall action
             DummyState(1),
             get_action((0, 0), (1, 1)),  # Catchall post
             DummyState(0),
             ]
     self.assertFalse(check_path(path))
示例#5
0
 def test_must_validate_post_condition2(self):
     path = [DummyState(1),
             get_action((0, 0), (0, 0)),  # Catchall action
             DummyState(1),
             get_action((0, 0), (1, 1)),  # Catchall post
             DummyState(0),
             ]
     self.assertFalse(check_path(path))
示例#6
0
 def test_path_is_valid(self):
     path = [DummyState(0),
             get_action((1, 0), (1, 1)),
             DummyState(1 + 4),
             get_action((1 + 2, 1), (1 + 2, 1 + 2)),
             DummyState(1 + 2 + 4),
             ]
     self.assertTrue(check_path(path))
示例#7
0
 def test_must_finish_with_state(self):
     path = [DummyState(0),
             get_action((0, 0), (0, 0)),  # Catchall action
             ]
     self.assertFalse(check_path(path))
示例#8
0
 def test_singleton_action_is_not_valid(self):
     self.assertFalse(check_path([get_action((1, 0), (1, 1))]))
示例#9
0
 def test_singleton_state_is_valid(self):
     self.assertTrue(check_path([DummyState(2)]))
示例#10
0
 def test_empty_path_is_valid(self):
     self.assertTrue(check_path([]))
示例#11
0
 def test_must_start_with_state(self):
     path = [get_action((0, 0), (0, 0)),  # Catchall action
             DummyState(0),
             ]
     self.assertFalse(check_path(path))
示例#12
0
 def test_must_finish_with_state(self):
     path = [DummyState(0),
             get_action((0, 0), (0, 0)),  # Catchall action
             ]
     self.assertFalse(check_path(path))
示例#13
0
 def test_singleton_action_is_not_valid(self):
     self.assertFalse(check_path([get_action((1, 0), (1, 1))]))
示例#14
0
 def test_singleton_state_is_valid(self):
     self.assertTrue(check_path([DummyState(2)]))
示例#15
0
 def test_empty_path_is_valid(self):
     self.assertTrue(check_path([]))
示例#16
0
 def test_must_start_with_state(self):
     path = [get_action((0, 0), (0, 0)),  # Catchall action
             DummyState(0),
             ]
     self.assertFalse(check_path(path))
示例#17
0
 def test_must_validate_pre_condition(self):
     path = [DummyState(1),
             get_action((1, 0), (0, 0)),  # Catchall pre
             DummyState(0),
             ]
     self.assertFalse(check_path(path))
示例#18
0
 def test_must_validate_pre_condition(self):
     path = [DummyState(1),
             get_action((1, 0), (0, 0)),  # Catchall pre
             DummyState(0),
             ]
     self.assertFalse(check_path(path))