diff --git a/requirements/dev.txt b/requirements/dev.txt index 681d75f..0bc670b 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -2,4 +2,4 @@ black==22.8.0 pylint==2.15.0 pytest==7.1.3 -mypy==0.971 \ No newline at end of file +mypy diff --git a/src/models.py b/src/models.py index ae0ac12..d750c6c 100644 --- a/src/models.py +++ b/src/models.py @@ -49,8 +49,8 @@ def for_day(cls, day: date) -> TimeWindow: def as_query_parameters(self) -> list[QueryParameter]: """Dune query parameters defined by the start and end of the window""" return [ - QueryParameter.date_type(name="StartTime", value=self.start), - QueryParameter.date_type(name="EndTime", value=self.end), + QueryParameter.date_type(name="start_time", value=self.start), + QueryParameter.date_type(name="end_time", value=self.end), ] def next(self) -> TimeWindow: diff --git a/tests/e2e/test_query_runner.py b/tests/e2e/test_query_runner.py index ae41f0f..7651254 100644 --- a/tests/e2e/test_query_runner.py +++ b/tests/e2e/test_query_runner.py @@ -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()}" @@ -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()}" @@ -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()}" diff --git a/tests/unit/test_models.py b/tests/unit/test_models.py index effd984..d4057fb 100644 --- a/tests/unit/test_models.py +++ b/tests/unit/test_models.py @@ -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) ), ], )