def test_xml_handler_givenExample(self): inputString = "<hphamnk> <THU><Team><ACRush></ACRush><Jelly></Jelly><Cooly></Cooly></Team><JiaJia><Team><Ahyangyi></Ahyangyi><Dragon></Dragon><Cooly><Amber></Amber></Cooly></Team></JiaJia></THU><Team><Cooly></Cooly></Team> </hphamnk>" #r = StringIO.StringIO(inputString) w = StringIO.StringIO() answer = xml_handler(inputString) self.assert_(answer == {0: 2, 1: 2, 2: 7})
def test_xml_handler_1occur_line1(self): inputString = "<hphamnk><THU></THU><THU></THU></hphamnk>" #r = StringIO.StringIO(inputString) w = StringIO.StringIO() answer = xml_handler(inputString) self.assert_(answer == {0: 1, 1: 1})
def test_xml_handler_is0(self): inputString = "<hphamnk> <THU> </THU> <B> </B> </hphamnk>" #r = StringIO.StringIO(inputString) w = StringIO.StringIO() answer = xml_handler(inputString) self.assert_(answer == {0: 0})