Skip to content

Commit

Permalink
Merge pull request #218 from mantiumai/AlexN/fix-tests
Browse files Browse the repository at this point in the history
Update outdated test setup
  • Loading branch information
alex-nork authored Nov 28, 2023
2 parents 973960c + 47d4ffb commit 9e44d1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions chirps/asset/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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%"}',
)

Expand Down Expand Up @@ -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')

Expand All @@ -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')

Expand All @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion docs/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
chirps-scanner.org
chirps-scanner.org

0 comments on commit 9e44d1e

Please sign in to comment.