summaryrefslogtreecommitdiff
path: root/src/mailman/rest/tests/test_root.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/rest/tests/test_root.py')
-rw-r--r--src/mailman/rest/tests/test_root.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/mailman/rest/tests/test_root.py b/src/mailman/rest/tests/test_root.py
index 5c134159d..7f3535496 100644
--- a/src/mailman/rest/tests/test_root.py
+++ b/src/mailman/rest/tests/test_root.py
@@ -19,6 +19,7 @@
__all__ = [
'TestRoot',
+ 'TestSystemConfiguration',
]
@@ -39,9 +40,19 @@ from six.moves.urllib_error import HTTPError
class TestRoot(unittest.TestCase):
layer = RESTLayer
- def test_root_system(self):
- # You can get the system preferences via the root path.
+ def test_root_system_backward_compatibility(self):
+ # The deprecated path for getting system version information points
+ # you to the new URL.
url = 'http://localhost:9001/3.0/system'
+ new = '{}/versions'.format(url)
+ json, response = call_api(url)
+ self.assertEqual(json['mailman_version'], system.mailman_version)
+ self.assertEqual(json['python_version'], system.python_version)
+ self.assertEqual(json['self_link'], new)
+
+ def test_system_versions(self):
+ # System version information is available via REST.
+ url = 'http://localhost:9001/3.0/system/versions'
json, response = call_api(url)
self.assertEqual(json['mailman_version'], system.mailman_version)
self.assertEqual(json['python_version'], system.python_version)
@@ -119,3 +130,8 @@ class TestRoot(unittest.TestCase):
self.assertEqual(content['title'], '401 Unauthorized')
self.assertEqual(content['description'],
'User is not authorized for the REST API')
+
+
+
+class TestSystemConfiguration(unittest.TestCase):
+ layer = RESTLayer