def test_invalid_nesting_split(self): self.assertRaises( ValueError, lambda: parse_composition(Split("a", Fuse("b", "c"), 128)))
def test_to_deep(self): self.assertRaises( ValueError, lambda: parse_composition( Stack("a", Fuse("b", Stack(Fuse("c", "d"), "e")))))
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")))
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"]]))