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))
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))
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))
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))
def test_must_finish_with_state(self): path = [DummyState(0), get_action((0, 0), (0, 0)), # Catchall action ] self.assertFalse(check_path(path))
def test_singleton_action_is_not_valid(self): self.assertFalse(check_path([get_action((1, 0), (1, 1))]))
def test_singleton_state_is_valid(self): self.assertTrue(check_path([DummyState(2)]))
def test_empty_path_is_valid(self): self.assertTrue(check_path([]))
def test_must_start_with_state(self): path = [get_action((0, 0), (0, 0)), # Catchall action DummyState(0), ] self.assertFalse(check_path(path))
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))