summaryrefslogtreecommitdiff
path: root/mirrors/tests/test_mirrorurl.py
diff options
context:
space:
mode:
Diffstat (limited to 'mirrors/tests/test_mirrorurl.py')
-rw-r--r--mirrors/tests/test_mirrorurl.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/mirrors/tests/test_mirrorurl.py b/mirrors/tests/test_mirrorurl.py
new file mode 100644
index 00000000..cd6eb763
--- /dev/null
+++ b/mirrors/tests/test_mirrorurl.py
@@ -0,0 +1,31 @@
+from django.test import TestCase
+
+from mirrors.tests import create_mirror_url
+
+
+class MirrorUrlTest(TestCase):
+ def setUp(self):
+ self.mirror_url = create_mirror_url()
+
+ def testAddressFamilies(self):
+ self.assertIsNotNone(self.mirror_url.address_families())
+
+ def testHostname(self):
+ self.assertEqual(self.mirror_url.hostname, 'archlinux.org')
+
+ def testGetAbsoluteUrl(self):
+ absolute_url = self.mirror_url.get_absolute_url()
+ expected = '/mirrors/%s/%d/' % (self.mirror_url.mirror.name, self.mirror_url.pk)
+ self.assertEqual(absolute_url, expected)
+
+ def test_mirror_overview(self):
+ response = self.client.get('/mirrors/')
+ self.assertEqual(response.status_code, 200)
+ self.assertIn(self.mirror_url.mirror.name, response.content)
+
+ def testClean(self):
+ # TODO: add test for self.mirror_url.clean()
+ pass
+
+ def tearDown(self):
+ self.mirror_url.delete()