summaryrefslogtreecommitdiff
path: root/src/mailman/rest/tests/test_root.py
diff options
context:
space:
mode:
authorBarry Warsaw2014-12-29 17:38:16 -0500
committerBarry Warsaw2014-12-29 17:38:16 -0500
commit477ac216b4abbd1f96ff4fa3a9583a76ca993dc3 (patch)
treea703c59e326bc9b8c2705f3052ca413dc9047f62 /src/mailman/rest/tests/test_root.py
parente86d49d01963640aeac7e27e6c7a49e298e3980f (diff)
downloadmailman-477ac216b4abbd1f96ff4fa3a9583a76ca993dc3.tar.gz
mailman-477ac216b4abbd1f96ff4fa3a9583a76ca993dc3.tar.zst
mailman-477ac216b4abbd1f96ff4fa3a9583a76ca993dc3.zip
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 d4d25ede0..a91a179e0 100644
--- a/src/mailman/rest/tests/test_root.py
+++ b/src/mailman/rest/tests/test_root.py
@@ -22,6 +22,7 @@ from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
'TestRoot',
+ 'TestSystemConfiguration',
]
@@ -42,9 +43,19 @@ from urllib2 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)
@@ -121,3 +132,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