Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix asset tests #185

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion chirps/asset/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,13 @@ def test_api_endpoint_asset_creation(self):

form_data = {
'name': 'API Endpoint Asset',
'description': 'Test API Endpoint Asset',
'url': 'https://api.example.com/endpoint',
'authentication_method': 'Bearer',
'api_key': 'example-api-key',
'headers': '{"Content-Type": "application/json"}',
'body': '{"data": "%query%"}',
'timeout': '30',
}
form = APIEndpointAssetForm(data=form_data)
self.assertTrue(form.is_valid(), form.errors)
Expand Down Expand Up @@ -283,7 +285,7 @@ def test_fetch_api_data(self):
expected_headers['Authorization'] = f'Bearer {self.api_endpoint_asset.api_key}'
expected_body = self.api_endpoint_asset.body.replace('%query%', 'test query')

mock_post.assert_called_once_with(expected_url, headers=expected_headers, json=expected_body, timeout=15)
mock_post.assert_called_once_with(expected_url, headers=expected_headers, json=expected_body, timeout=30)

# Assert the search result attributes
result = search_results['chat']
Expand Down
Loading