def test_empty(self): generator = HTMLChildGenerator() generator.append(u"c1") generator.extend([u"c2", u"c3", NullGenerator()]) generator.empty() assert_equal([], list(iter(generator)))
def test_remove_raw_not_found(self): generator = HTMLChildGenerator() generator.extend(["foo", "bar"]) with assert_raises(ValueError): generator.remove_raw("baz")
def test_len(self): generator = HTMLChildGenerator() generator.append(u"c1") generator.extend([u"c2", u"c3", NullGenerator()]) assert_equal(4, len(generator))
def test_extend(self): generator = HTMLChildGenerator() generator.append(u"c1") generator.extend([_TestingGenerator([u"c2", u"c&3"]), u"<c4>"]) assert_equal([b"c1", b"c2", b"c&3", b"<c4>"], list(iter(generator)))