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:
Paul Gauthier 2024-06-08 12:55:13 -07:00
parent 1f1da4b1a2
commit 2d55d532be

9
tests/test_urls.py Normal file
View 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}"