def test_to_tuple_as_file(self): """ Test to_tuple method on all example files as xml string object """ for f in FILES: with open(os.path.join(EXAMPLES_DIR, f), "r") as fname: self.assertIsInstance(fname, file) # make sure fname is file parser.to_tuple(fname)
def test_to_tuple_as_str(self): """ Test to_tuple method on all example files as xml string object """ for f in FILES: with open(os.path.join(EXAMPLES_DIR, f), "r") as fname: xml_str = fname.read() # test xml as str self.assertIsInstance(xml_str, str) # make sure xml is str parser.to_tuple(xml_str)