Skip to content

Commit

Permalink
fix copy/pasting issue
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Garcia Reolid <[email protected]>
  • Loading branch information
victorgarcia98 committed Jul 17, 2024
1 parent 4f2808b commit 90da973
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions timely_beliefs/tests/test_belief_persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,13 @@ def test_adding_to_session_fails(
session=session,
sensor=time_slot_sensor,
)
n_beliefs_before = len(bdf)

if bulk_save_objects:
# Attempting to save the same data should not yield new data in the database
# Attempting to save the same data should fail, even if we expunge everything from the session
with pytest.raises(IntegrityError):
DBTimedBelief.add_to_session(
session,
bdf,
expunge_session=True,
bulk_save_objects=False,
commit_transaction=True,
)
bdf = DBTimedBelief.search_session(
session=session,
sensor=time_slot_sensor,
)
n_beliefs_after = len(bdf)
assert n_beliefs_after == n_beliefs_before
else:
# Attempting to save the same data should fail, even if we expunge everything from the session
with pytest.raises(IntegrityError):
DBTimedBelief.add_to_session(
session,
bdf,
expunge_session=True,
bulk_save_objects=bulk_save_objects,
commit_transaction=True,
)

0 comments on commit 90da973

Please sign in to comment.