Skip to content

Commit

Permalink
fixed some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fhenneke committed Sep 20, 2024
1 parent 111a5d9 commit cb7d7d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions tests/e2e/test_query_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def test_query_runner(self, mocked_post):
query = load_config(filepath("v2-test-data.yaml")).query
dune = DuneClient(os.environ["DUNE_API_KEY"])
slack_client = BasicSlackClient(token="Fake Token", channel="Fake Channel")
query_runner = QueryRunner(query, dune, slack_client)
ping_frequency = 10
query_runner = QueryRunner(query, dune, slack_client, ping_frequency)
query_runner.run_loop()
mocked_post.assert_called_with(
f"{query.name} - detected 1 cases. Results available at {query.result_url()}"
Expand All @@ -30,7 +31,8 @@ def test_v3_query(self, mocked_post):
query = load_config(filepath("v3-left-bounded.yaml")).query
dune = DuneClient(os.environ["DUNE_API_KEY"])
slack_client = BasicSlackClient(token="Fake Token", channel="Fake Channel")
query_runner = QueryRunner(query, dune, slack_client)
ping_frequency = 10
query_runner = QueryRunner(query, dune, slack_client, ping_frequency)
query_runner.run_loop()
mocked_post.assert_called_with(
f"{query.name} - detected 1 cases. Results available at {query.result_url()}"
Expand All @@ -42,7 +44,8 @@ def test_v3_last_hour(self, mocked_post):
query = load_config(filepath("v3-last-hour.yaml")).query
dune = DuneClient(os.environ["DUNE_API_KEY"])
slack_client = BasicSlackClient(token="Fake Token", channel="Fake Channel")
query_runner = QueryRunner(query, dune, slack_client)
ping_frequency = 10
query_runner = QueryRunner(query, dune, slack_client, ping_frequency)
query_runner.run_loop()
mocked_post.assert_called_with(
f"{query.name} - detected 1 cases. Results available at {query.result_url()}"
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def test_as_query_params(self):
self.assertEqual(
window.as_query_parameters(),
[
QueryParameter.date_type(name="StartTime", value=self.start),
QueryParameter.date_type(name="start_time", value=self.start),
QueryParameter.date_type(
name="EndTime", value=self.start + timedelta(hours=window.length)
name="end_time", value=self.start + timedelta(hours=window.length)
),
],
)
Expand Down

0 comments on commit cb7d7d0

Please sign in to comment.