X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=tests%2Ftest_inp.py;h=f51e730cf7352cfd613d60cc873bba7727818571;hb=2903febd2767ffd94f62f8e0b151e627e15b09d5;hp=9471421cc38392b215da1dafd75fb1048cf9d101;hpb=e19edc2c673b2f672d613c97bce91c0ec238e80a;p=m_librarian.git diff --git a/tests/test_inp.py b/tests/test_inp.py index 9471421..f51e730 100644 --- a/tests/test_inp.py +++ b/tests/test_inp.py @@ -1,13 +1,15 @@ -from tests import TestCase +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_bad_inpx(): + raises(ValueError, load_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_inpx(): + load_inpx('test.inpx') + assert Author.select().count() == 5 + assert Book.select().count() == 5