Beispiel #1
0
 def test_or_call(self):
     p = Path("A", "B") | Path("C", "D")
     self.assertTrue(p(["A", "B", "C", "D"]))
     self.assertTrue(p(["Z", "A", "B", "M", "C", "D", "N"]))
     self.assertTrue(p(["A", "B"]))
     self.assertTrue(p(["C", "D"]))
     self.assertFalse(p(["B", "C"]))
Beispiel #2
0
    class D(BaseTestState, previous=['C']):
        def input(self):
            pass

        @condition(Path("A", "C"))
        def test_1(self):
            spy('D.test_1 /AC')

        @condition(- Path("A", "C"))
        def test_2(self):
            spy('D.test_2 /-AC')
Beispiel #3
0
    class C(BaseTestState, previous=['B1', 'B2']):

        @condition(Path('B1'))
        def input(self):
            spy('C.input')

        def test_1(self):
            spy('C.test_1')
Beispiel #4
0
 def test_not_call(self):
     p = - Path("A", "B")
     self.assertFalse(p(["A", "B"]))
     self.assertFalse(p(["A", "B", "C"]))
     self.assertFalse(p(["Z", "A", "B"]))
     self.assertFalse(p(["Z", "A", "B", "C"]))
     self.assertTrue(p(["A"]))
     self.assertTrue(p(["A", "C"]))
     self.assertTrue(p(["A", "C", "B"]))
Beispiel #5
0
    class B(BaseTestState, previous=['A']):

        @previous(['A'])
        def input(self):
            pass

        @condition(Path('A'))
        def input(self):
            pass