Skip to content

Commit

Permalink
added check for file key
Browse files Browse the repository at this point in the history
Signed-off-by: Pratiksha Sankhe <[email protected]>
  • Loading branch information
psankhe28 committed Oct 14, 2024
1 parent 42caf72 commit 097a550
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_integration/test_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ def test_get_files():
with mock.patch("requests.get") as mock_get:
mock_response = mock.Mock()
mock_response.status_code = HTTPStatus.OK
mock_response.json.return_value = {"files": ["file1.txt", "file2.txt"]}
mock_get.return_value = mock_response

response = requests.get(server_url)
print(f"Response status code: {response.status_code}")

assert (
response.status_code == HTTPStatus.OK
), f"Expected status code 200, got {response.status_code}"
assert response.status_code == HTTPStatus.OK
assert "files" in response.json()
assert isinstance(response.json()["files"], list)

mock_get.assert_called_once_with(server_url)

Expand Down

0 comments on commit 097a550

Please sign in to comment.