-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test cases in Indexer to improve test coverage
- Loading branch information
Ananya Agrawal
authored and
Ananya Agrawal
committed
Dec 16, 2024
1 parent
f2251a5
commit 9e141cc
Showing
2 changed files
with
160 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from model import InternalServerException, ServiceUnavailableException | ||
|
||
# Test for InternalServerException | ||
def test_internal_server_exception(): | ||
message = "An internal server error occurred" | ||
exception = InternalServerException(message) | ||
|
||
assert exception.message == message | ||
assert exception.status_code == 500 | ||
assert str(exception) == message | ||
|
||
|
||
# Test for ServiceUnavailableException | ||
def test_service_unavailable_exception(): | ||
message = "Service is unavailable" | ||
exception = ServiceUnavailableException(message) | ||
|
||
assert exception.message == message | ||
assert exception.status_code == 503 | ||
assert str(exception) == message |