From 9f5e2cd4a46349d161d5ec22c65d212a52215c47 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 13 Dec 2020 15:07:03 +0100 Subject: Add a test repo with bad types. This should restore 100% coverage. --- pydis_site/apps/home/tests/mock_github_api_response.json | 7 +++++++ pydis_site/apps/home/views/home.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) 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 @@ -34,6 +34,13 @@ "language": "Python", "forks_count": 31 }, + { + "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", 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() -- cgit v1.2.3