예제 #1
0
 def test_invalid_nesting_split(self):
     self.assertRaises(
         ValueError,
         lambda: parse_composition(Split("a", Fuse("b", "c"), 128)))
예제 #2
0
 def test_to_deep(self):
     self.assertRaises(
         ValueError, lambda: parse_composition(
             Stack("a", Fuse("b", Stack(Fuse("c", "d"), "e")))))
예제 #3
0
 def test_invalid_nesting_fusion(self):
     self.assertRaises(ValueError,
                       lambda: parse_composition(Fuse(Fuse("a", "b"), "c")))
     self.assertRaises(
         ValueError,
         lambda: parse_composition(Fuse(Split("a", "b", 128), "c")))
예제 #4
0
 def test_parse_lists(self):
     self.assertEqual(Stack("a"), parse_composition("a"))
     self.assertEqual(Stack("a", "b", "c"),
                      parse_composition(["a", "b", "c"]))
     self.assertEqual(Stack("a", Fuse("b", "c")),
                      parse_composition(["a", ["b", "c"]]))