summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Hanna2016-04-02 02:07:58 +0200
committerSimon Hanna2016-04-02 02:09:44 +0200
commitc519cd8740bb3ce06ab58618bbb2e1a3d2870946 (patch)
treebcc455a0d55f660d95ef60715b8b1d918559dfb1 /src
parent41bbb438b1b56e7837bfaf459d0d69381172e5df (diff)
downloadmailman-c519cd8740bb3ce06ab58618bbb2e1a3d2870946.tar.gz
mailman-c519cd8740bb3ce06ab58618bbb2e1a3d2870946.tar.zst
mailman-c519cd8740bb3ce06ab58618bbb2e1a3d2870946.zip
Add tests for exposed chains and pipelines
Diffstat (limited to 'src')
-rw-r--r--src/mailman/rest/tests/test_root.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/mailman/rest/tests/test_root.py b/src/mailman/rest/tests/test_root.py
index ea2f2da5e..26041b9e6 100644
--- a/src/mailman/rest/tests/test_root.py
+++ b/src/mailman/rest/tests/test_root.py
@@ -63,6 +63,36 @@ class TestRoot(unittest.TestCase):
call_api('http://localhost:9001/3.0/system/foo')
self.assertEqual(cm.exception.code, 404)
+ def test_system_pipelines_are_exposed(self):
+ call_api('http://localhost:9001/3.0/system/pipelines')
+
+ def test_system_pipelines_are_read_only(self):
+ with self.assertRaises(HTTPError) as cm:
+ call_api('http://localhost:9001/3.0/system/pipelines', {
+ 'pipelines': ['pipeline_1', 'pipeline_2']
+ }, method='PATCH')
+ self.assertEqual(cm.exception.code, 405)
+ with self.assertRaises(HTTPError) as cm:
+ call_api('http://localhost:9001/3.0/system/pipelines', {
+ 'pipelines': ['pipeline_1', 'pipeline_2']
+ }, method='PUT')
+ self.assertEqual(cm.exception.code, 405)
+
+ def test_system_chains_are_exposed(self):
+ call_api('http://localhost:9001/3.0/system/chains')
+
+ def test_system_chains_are_read_only(self):
+ with self.assertRaises(HTTPError) as cm:
+ call_api('http://localhost:9001/3.0/system/chains', {
+ 'chains': ['chain_1', 'chain_2']
+ }, method='PATCH')
+ self.assertEqual(cm.exception.code, 405)
+ with self.assertRaises(HTTPError) as cm:
+ call_api('http://localhost:9001/3.0/system/chains', {
+ 'chains': ['chain_1', 'chain_2']
+ }, method='PUT')
+ self.assertEqual(cm.exception.code, 405)
+
def test_system_preferences_are_read_only(self):
# /system/preferences are read-only.
with self.assertRaises(HTTPError) as cm: