def test_wrong_apidoc1(self): self.file.write(wrong_apidoc_data[1].encode('utf-8')) self.file.close() with self.assertRaises(ValueError): ret = parse_apidoc(self.file.name)
def setUp(self): self.file = tempfile.NamedTemporaryFile(delete=False) self.file.write(test_data.encode('utf-8')) self.file.close() self.ret = parse_apidoc(self.file.name) os.remove(self.file.name)
def test_read(self): self.file.write(test_data.encode('utf-8')) self.file.close() ret = parse_apidoc(self.file.name) self.assertEqual(len(ret), 3)