diff test/test_config.py @ 5770:f91da208f26b

Validate that TRACKER_WEB url starts with https:// or http:// and ends with a /.
author John Rouillard <rouilj@ieee.org>
date Wed, 05 Jun 2019 21:11:50 -0400
parents dd642afb4440
children 8dbe307bdb57
line wrap: on
line diff
--- a/test/test_config.py	Thu Jun 06 00:22:42 2019 +0200
+++ b/test/test_config.py	Wed Jun 05 21:11:50 2019 -0400
@@ -50,3 +50,21 @@
         """Run configure tests looking for invalid option name
         """
         self.assertEquals(config._get_option("FOO"), "value")
+
+    def testTrackerWeb(self):
+        config = configuration.CoreConfig()
+
+        self.assertEqual(None,
+             config._get_option('TRACKER_WEB').set("http://foo.example/bar/"))
+        self.assertEqual(None,
+             config._get_option('TRACKER_WEB').set("https://foo.example/bar/"))
+
+        self.assertRaises(configuration.OptionValueError,
+             config._get_option('TRACKER_WEB').set, "https://foo.example/bar")
+
+        self.assertRaises(configuration.OptionValueError,
+             config._get_option('TRACKER_WEB').set, "htt://foo.example/bar/")
+
+        self.assertRaises(configuration.OptionValueError,
+             config._get_option('TRACKER_WEB').set, "htt://foo.example/bar")
+

Roundup Issue Tracker: http://roundup-tracker.org/