mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
aider: Add test to ensure all URLs return a 200 status code.
# Aider chat conversation: USER: write a test that makes sure all the urls are 200 ASSISTANT: Here is the test to ensure all the URLs return a 200 status code: tests/test_urls.py ```python <<<<<<< SEARCH ======= import requests from aider import urls def test_urls(): url_attributes = [attr for attr in dir(urls) if not callable(getattr(urls, attr)) and not attr.startswith("__")] for attr in url_attributes: url = getattr(urls, attr) response = requests.get(url) assert response.status_code == 200, f"URL {url} returned status code {response.status_code}" >>>>>>> REPLACE ```
This commit is contained in:
parent
1f1da4b1a2
commit
2d55d532be
1 changed files with 9 additions and 0 deletions
9
tests/test_urls.py
Normal file
9
tests/test_urls.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import requests
|
||||
from aider import urls
|
||||
|
||||
def test_urls():
|
||||
url_attributes = [attr for attr in dir(urls) if not callable(getattr(urls, attr)) and not attr.startswith("__")]
|
||||
for attr in url_attributes:
|
||||
url = getattr(urls, attr)
|
||||
response = requests.get(url)
|
||||
assert response.status_code == 200, f"URL {url} returned status code {response.status_code}"
|
Loading…
Add table
Add a link
Reference in a new issue