Skip to content

Commit

Permalink
TST: Improve get_events test
Browse files Browse the repository at this point in the history
skipci
  • Loading branch information
cortadocodes committed Aug 6, 2024
1 parent 681f476 commit 7c1c65b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/cloud/pub_sub/test_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ def test_error_if_more_than_one_question_uuid_type_provided(self):
with self.assertRaises(ValueError):
get_events(table_id="blah", **kwargs)

def test_error_raised_if_event_kind_invalid(self):
"""Test that an error is raised if the event kind is invalid."""
with self.assertRaises(ValueError):
get_events(table_id="blah", question_uuid="blah", kinds="frisbee_tournament")
def test_error_raised_if_kinds_invalid(self):
"""Test that an error is raised if the event kinds are invalid."""
for invalid_kinds in ["frisbee_tournament", ["frisbee_tournament"]]:
with self.subTest(invalid_kinds=invalid_kinds):
with self.assertRaises(ValueError):
get_events(table_id="blah", question_uuid="blah", kinds=invalid_kinds)

def test_no_events_found(self):
"""Test that an empty list is returned if no events are found for the question UUID."""
Expand Down

0 comments on commit 7c1c65b

Please sign in to comment.