예제 #1
0
 def test_remove_generator(self):
     sub_generator = Generator()
     generator = HTMLChildGenerator()
     generator.append(sub_generator)
     generator.append("foo")
     generator.remove(sub_generator)
     assert_equal([b"foo"], list(iter(generator)))
예제 #2
0
 def test_remove(self):
     generator = HTMLChildGenerator()
     generator.extend_raw(["foo", "bar", "lower < than"])
     generator.remove("foo")
     generator.remove("lower < than")
     assert_equal([b"bar"], list(iter(generator)))
예제 #3
0
 def test_remove_not_found(self):
     generator = HTMLChildGenerator()
     generator.extend(["foo", "bar"])
     with assert_raises(ValueError):
         generator.remove("baz")