forked from dbpedia/ontology-time-machine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjust the proxy logic based on the canvas
- Loading branch information
Jenifer Tabita Ciuciu-Kiss
committed
Jul 5, 2024
1 parent
3658201
commit 2b13d78
Showing
4 changed files
with
279 additions
and
31 deletions.
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
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,38 @@ | ||
import requests | ||
|
||
|
||
def mock_response_200(): | ||
mock_response = requests.Response() | ||
mock_response.status_code = 200 | ||
mock_response.url = 'https://example.com/success' | ||
mock_response.headers['Content-Type'] = 'text/html' | ||
mock_response._content = b'<html><body><h1>To be implemented</h1></body></html>' | ||
return mock_response | ||
|
||
|
||
def mock_response_403(): | ||
mock_response = requests.Response() | ||
mock_response.status_code = 403 | ||
mock_response.url = 'https://example.com/forbidden' | ||
mock_response.headers['Content-Type'] = 'text/html' | ||
mock_response._content = b'<html><body><h1>403 Forbidden</h1></body></html>' | ||
return mock_response | ||
|
||
|
||
|
||
def mock_response_404(): | ||
mock_response = requests.Response() | ||
mock_response.status_code = 404 | ||
mock_response.url = 'https://example.com/resource-not-found' | ||
mock_response.headers['Content-Type'] = 'text/html' | ||
mock_response._content = b'<html><body><h1>404 Not Found</h1></body></html>' | ||
return mock_response | ||
|
||
|
||
def mock_response_500(): | ||
mock_response = requests.Response() | ||
mock_response.status_code = 500 | ||
mock_response.url = 'https://example.com/internal-server-error' | ||
mock_response.headers['Content-Type'] = 'text/html' | ||
mock_response._content = b'<html><body><h1>500 Internal Server Error</h1></body></html>' | ||
return mock_response |
Oops, something went wrong.