Skip to content

Commit

Permalink
added timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
NikkiBytes committed Dec 5, 2024
1 parent f4de5e9 commit 49cff33
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/tests/_utils/metakg/integration/parser/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ def setUp(self):
# POST Tests
def test_post_metakg_parse_api_details_1_bte_1(self):
url = "http://localhost:8000/api/metakg/parse?api_details=1&bte=1"
response = requests.post(url, headers=self.headers, json=self.data)
response = requests.post(url, headers=self.headers, json=self.data, timeout=self.TIMEOUT)
json_response = response.json()
self.assertEqual(response.status_code, 200)
self.assertIn('api', json_response['hits'][0].keys())
self.assertIn('bte', json_response['hits'][0].keys())

def test_post_metakg_parse_api_details_0_bte_1(self):
url = "http://localhost:8000/api/metakg/parse?api_details=0&bte=1"
response = requests.post(url, headers=self.headers, json=self.data)
response = requests.post(url, headers=self.headers, json=self.data, timeout=self.TIMEOUT)
json_response = response.json()
self.assertEqual(response.status_code, 200)
self.assertIn('bte', json_response['hits'][0].keys())

def test_post_metakg_parse_api_details_1_bte_0(self):
url = "http://localhost:8000/api/metakg/parse?api_details=1&bte=0"
response = requests.post(url, headers=self.headers, json=self.data)
response = requests.post(url, headers=self.headers, json=self.data, timeout=self.TIMEOUT)
json_response = response.json()
self.assertEqual(response.status_code, 200)
self.assertIn('api', json_response['hits'][0].keys())
self.assertNotIn('bte', json_response['hits'][0].keys())

def test_post_metakg_parse_api_details_0_bte_0(self):
url = "http://localhost:8000/api/metakg/parse?api_details=0&bte=0"
response = requests.post(url, headers=self.headers, json=self.data)
response = requests.post(url, headers=self.headers, json=self.data, timeout=self.TIMEOUT)
json_response = response.json()
self.assertEqual(response.status_code, 200)
self.assertNotIn('bte', json_response['hits'][0].keys())
Expand All @@ -46,30 +46,30 @@ def test_post_metakg_parse_api_details_0_bte_0(self):
# GET Tests
def test_get_metakg_parse_api_details_1_bte_1(self):
url = f"http://localhost:8000/api/metakg/parse?url={self.URL_EXAMPLE}&api_details=1&bte=1"
response = requests.get(url)
response = requests.get(url, timeout=self.TIMEOUT)
json_response = response.json()
self.assertEqual(response.status_code, 200)
self.assertIn('api', json_response['hits'][0].keys())
self.assertIn('bte', json_response['hits'][0].keys())

def test_get_metakg_parse_api_details_0_bte_1(self):
url = f"http://localhost:8000/api/metakg/parse?url={self.URL_EXAMPLE}&api_details=0&bte=1"
response = requests.get(url)
response = requests.get(url, timeout=self.TIMEOUT)
json_response = response.json()
self.assertEqual(response.status_code, 200)
self.assertIn('bte', json_response['hits'][0].keys())

def test_get_metakg_parse_api_details_1_bte_0(self):
url = f"http://localhost:8000/api/metakg/parse?url={self.URL_EXAMPLE}&api_details=1&bte=0"
response = requests.get(url)
response = requests.get(url, timeout=self.TIMEOUT)
json_response = response.json()
self.assertEqual(response.status_code, 200)
self.assertIn('api', json_response['hits'][0].keys())
self.assertNotIn('bte', json_response['hits'][0].keys())

def test_get_metakg_parse_api_details_0_bte_0(self):
url = f"http://localhost:8000/api/metakg/parse?url={self.URL_EXAMPLE}&api_details=0&bte=0"
response = requests.get(url)
response = requests.get(url, timeout=self.TIMEOUT)
json_response = response.json()
self.assertEqual(response.status_code, 200)
self.assertNotIn('bte', json_response['hits'][0].keys())
Expand Down

0 comments on commit 49cff33

Please sign in to comment.