Skip to content

Commit

Permalink
add dry insert tests to all inserts
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisSanchez25 committed Aug 1, 2023
1 parent aa555d0 commit e0402fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,16 @@ def insert_data(
):
PERMISSIONS["insert"] = False
with tester.assertRaises(InsertionError):
cls.dry_insert_data(tester, db, docs)
db.insert(docs)

PERMISSIONS["insert"] = True
cls.dry_insert_data(tester, db, docs)
db.insert(docs)

PERMISSIONS["update"] = False
with tester.assertRaises(UpdateError):
cls.dry_insert_data(tester, db, docs)
db.insert(docs)

@classmethod
Expand Down Expand Up @@ -147,13 +150,13 @@ def frame_test(
assert are_equal(sorted(rf[field].unique()), unique_vals)
assert are_equal(sorted(rf.unique(field)), unique_vals)


@classmethod
def test(cls, tester: unittest.TestCase, db, docs: List["BaseTestSchema"]):
cls.insert_data(tester, db, docs)
cls.basic_tests(tester, db, docs)
cls.frame_test(tester, db, docs)
cls.delete_data(tester, db, docs)
cls.dry_insert_data(tester, db, docs)


class SimpleSchema(BaseTestSchema):
Expand Down

0 comments on commit e0402fb

Please sign in to comment.