]> git.phdru.name Git - m_librarian.git/blobdiff - tests/test_inp.py
Feat(inpx): Import new (17 fields) INP
[m_librarian.git] / tests / test_inp.py
old mode 100755 (executable)
new mode 100644 (file)
index 6aeefd1..f51e730
@@ -1,19 +1,15 @@
-#! /usr/bin/env python
 
-
-from tests import TestCase, main
+from pytest import raises
+from dbutils import setup_module, teardown_module  # noqa
+from dbutils import load_inpx
 from m_librarian.db import Author, Book
 
 
-class TestInp(TestCase):
-    def test_import_bad_inpx(self):
-        self.assertRaises(ValueError, self.import_inpx, 'bad.inpx')
-
-    def test_import_inpx(self):
-        self.import_inpx('test.inpx')
-        self.assertEqual(Author.select().count(), 4)
-        self.assertEqual(Book.select().count(), 4)
+def test_import_bad_inpx():
+    raises(ValueError, load_inpx, 'bad.inpx')
 
 
-if __name__ == "__main__":
-    main()
+def test_import_inpx():
+    load_inpx('test.inpx')
+    assert Author.select().count() == 5
+    assert Book.select().count() == 5