Permalink
Browse files

mirrorlist: Complete /all/https success test case

Also, remove test_generate(), as it was testing no more than
test_mirrorlist_filter() already was.

Signed-off-by: Genki Sky <sky@genki.is>
  • Loading branch information...
Genki Sky authored and jelly committed Apr 22, 2018
1 parent a0ce797 commit a33fd7e26594a72fa1e1a9c056cb17524f7c9363
Showing with 10 additions and 6 deletions.
  1. +10 −6 mirrors/tests/test_mirrorlist.py
@@ -25,9 +25,18 @@ def test_mirrorlist_all_http(self):
self.assertIn(self.mirror_url.hostname, response.content)
def test_mirrorlist_all_https(self):
# First test that without any https mirrors, we get a 404.
response = self.client.get('/mirrorlist/all/https/')
self.assertEqual(response.status_code, 404)
# TODO: test 200 case
# Now, after adding an HTTPS mirror, we expect to succeed.
https_mirror_url = create_mirror_url(
name='https_mirror',
protocol='https',
url='https://wikipedia.org')
response = self.client.get('/mirrorlist/all/https/')
self.assertEqual(response.status_code, 200)
https_mirror_url.delete()
def test_mirrorlist_filter(self):
jp_mirror_url = create_mirror_url(
@@ -45,8 +54,3 @@ def test_mirrorlist_filter(self):
self.assertNotIn(self.mirror_url.hostname, response.content)
jp_mirror_url.delete()
def test_generate(self):
response = self.client.get('/mirrorlist/?country=all&protocol=http&ip_version=4')
self.assertEqual(response.status_code, 200)
self.assertIn(self.mirror_url.hostname, response.content)

0 comments on commit a33fd7e

Please sign in to comment.