diff options
author | 2020-12-13 15:07:03 +0100 | |
---|---|---|
committer | 2020-12-13 15:07:03 +0100 | |
commit | 9f5e2cd4a46349d161d5ec22c65d212a52215c47 (patch) | |
tree | d521ea582b4fd060b37270f1169a58ae4cb77e59 /pydis_site | |
parent | Fix test for HomeView. (diff) |
Add a test repo with bad types.
This should restore 100% coverage.
Diffstat (limited to 'pydis_site')
-rw-r--r-- | pydis_site/apps/home/tests/mock_github_api_response.json | 7 | ||||
-rw-r--r-- | pydis_site/apps/home/views/home.py | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/pydis_site/apps/home/tests/mock_github_api_response.json b/pydis_site/apps/home/tests/mock_github_api_response.json index ddbffed8..00f2840d 100644 --- a/pydis_site/apps/home/tests/mock_github_api_response.json +++ b/pydis_site/apps/home/tests/mock_github_api_response.json @@ -36,6 +36,13 @@ }, { "full_name": "python-discord/sir-lancebot", + "description": 42, + "stargazers_count": "bad types", + "language": ["not", "the", "right", "type"], + "forks_count": "31" + }, + { + "full_name": "python-discord/sir-lancebot", "description": "test", "stargazers_count": 97, "language": "Python", diff --git a/pydis_site/apps/home/views/home.py b/pydis_site/apps/home/views/home.py index ddbfc4b4..77496121 100644 --- a/pydis_site/apps/home/views/home.py +++ b/pydis_site/apps/home/views/home.py @@ -76,7 +76,7 @@ class HomeView(View): # If we don't, we have to create some! if not cached_data: - # Try to get new data from the API. If it fails, return an empty list. + # Try to get new data from the API. If it fails, we'll return an empty list. # In this case, we simply don't display our projects on the site. api_repositories = self._get_api_data() |