def test_tokenizer1(self): print("TEST_TOKENIZER #1") s = StringIO.StringIO("<THU><Team></Team><JiaJia><Team></Team></JiaJia></THU><JiaJia></JiaJia>") tree, sep, search = xml_tokenizer(s) self.assert_(tree == "<THU><Team></Team><JiaJia><Team></Team></JiaJia>") self.assert_(sep == "</THU>") self.assert_(search == "<JiaJia></JiaJia>")
def test_tokenizer3(self): s = SringIO.StringIO("<THU><Team><thu></thr></Team></THU><JiaJia></JiaJia>") tree, sep, search = xml_tokenizer(s) self.assert_(tree == "<THU><Team><thu></thr></Team>") self.assert_(sep == "</THU>") self.assert_(search == "<JiaJia></JiaJia>")
def test_tokenizer2(self): s = SringIO.StringIO("<Taylor><Holly></Holly></Taylor><Holly></Holly>") tree, sep, search = xml_tokenizer(s) self.assert_(tree == "<Taylor><Holly></Holly>") self.assert_(sep == "</Taylor>") self.assert_(search == "<Holly></Holly>")