From 82423e8d985a67eb1df445dce197e3c8a47aca47 Mon Sep 17 00:00:00 2001 From: Alex Nork <48630278+alex-nork@users.noreply.github.com> Date: Tue, 28 Nov 2023 14:52:58 +0000 Subject: [PATCH 1/2] Fix outdated test setup causing test failures --- chirps/asset/tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chirps/asset/tests.py b/chirps/asset/tests.py index 1408cfc..9cc459a 100644 --- a/chirps/asset/tests.py +++ b/chirps/asset/tests.py @@ -269,7 +269,7 @@ def setUp(self): url='https://api.example.com/endpoint', authentication_method='Bearer', api_key='example-api-key', - headers='{"Content-Type": "application/json"}', + headers={"Content-Type": "application/json"}, body='{"data": "%query%"}', ) @@ -299,7 +299,7 @@ def test_fetch_api_data(self): # Assert that requests.post was called with the expected arguments expected_url = self.api_endpoint_asset.url - expected_headers = json.loads(self.api_endpoint_asset.headers) + expected_headers = self.api_endpoint_asset.headers expected_headers['Authorization'] = f'Bearer {self.api_endpoint_asset.api_key}' expected_body = self.api_endpoint_asset.body.replace('%query%', 'test query') @@ -326,7 +326,7 @@ def test_test_connection(self): self.assertIsNone(ping_result.error) expected_url = self.api_endpoint_asset.url - expected_headers = json.loads(self.api_endpoint_asset.headers) + expected_headers = self.api_endpoint_asset.headers expected_headers['Authorization'] = f'Bearer {self.api_endpoint_asset.api_key}' expected_body = self.api_endpoint_asset.body.replace('%query%', 'Test message') @@ -346,7 +346,7 @@ def test_test_connection_failure(self): self.assertIn(mock_response_data['error'], ping_result.error) expected_url = self.api_endpoint_asset.url - expected_headers = json.loads(self.api_endpoint_asset.headers) + expected_headers = self.api_endpoint_asset.headers expected_headers['Authorization'] = f'Bearer {self.api_endpoint_asset.api_key}' expected_body = self.api_endpoint_asset.body.replace('%query%', 'Test message') From 47d4ffb7c60172fcd1e3806578d123c9c3bc48f9 Mon Sep 17 00:00:00 2001 From: Alex Nork <48630278+alex-nork@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:01:08 +0000 Subject: [PATCH 2/2] run pre-commit hooks --- chirps/asset/tests.py | 2 +- docs/CNAME | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chirps/asset/tests.py b/chirps/asset/tests.py index 9cc459a..9c190b9 100644 --- a/chirps/asset/tests.py +++ b/chirps/asset/tests.py @@ -269,7 +269,7 @@ def setUp(self): url='https://api.example.com/endpoint', authentication_method='Bearer', api_key='example-api-key', - headers={"Content-Type": "application/json"}, + headers={'Content-Type': 'application/json'}, body='{"data": "%query%"}', ) diff --git a/docs/CNAME b/docs/CNAME index f8e19df..2c05b55 100644 --- a/docs/CNAME +++ b/docs/CNAME @@ -1 +1 @@ -chirps-scanner.org \ No newline at end of file +chirps-scanner.org