5 from tests import TestCase, main
6 from m_librarian.db import Author, Book
7 from m_librarian.inp import import_inpx
10 class TestInp(TestCase):
11 def test_import_bad_inpx(self):
13 ValueError, import_inpx,
14 os.path.join(os.path.dirname(__file__), 'bad.inpx'))
16 def test_import_inpx(self):
17 import_inpx(os.path.join(os.path.dirname(__file__), 'test.inpx'))
18 self.assertEqual(Author.select().count(), 4)
19 self.assertEqual(Book.select().count(), 4)
22 if __name__ == "__main__":