示例#1
0
 def test_remove_raw_generator(self):
     sub_generator = Generator()
     generator = HTMLChildGenerator()
     generator.append(sub_generator)
     generator.append("foo")
     generator.remove_raw(sub_generator)
     assert_equal([b"foo"], list(iter(generator)))
示例#2
0
 def test_remove_raw(self):
     generator = HTMLChildGenerator()
     generator.extend_raw(["foo", "bar", "lower < than"])
     generator.remove_raw("foo")
     generator.remove_raw("lower < than")
     assert_equal([b"bar"], list(iter(generator)))
示例#3
0
 def test_remove_raw_not_found(self):
     generator = HTMLChildGenerator()
     generator.extend(["foo", "bar"])
     with assert_raises(ValueError):
         generator.remove_raw("baz")