summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2019-11-13 12:57:57 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2019-11-13 14:15:56 +0100
commitc1a046d2052fd0c92504c34c126e38dc7b12b84c (patch)
tree444d522be377bc4b002af037599d6c8229b75cc7
parent9381fdf5ce30b1c3aaabab6d6296593812dd8433 (diff)
#915 Extend REST API POST no payload tests to all remaining tests.
This patch extends tests for requests without any payload in the following REST API POST functions: - /clients - /wol - /shell/run - /shell/output - /session - /poweroff - /reboot - /stop - /refresh - /hardware - /software
-rw-r--r--admin/Sources/Services/ogAdmServer/tests/units/test_0002_post_clients.py4
-rw-r--r--admin/Sources/Services/ogAdmServer/tests/units/test_0003_post_wol.py4
-rw-r--r--admin/Sources/Services/ogAdmServer/tests/units/test_0004_post_shell_run.py4
-rw-r--r--admin/Sources/Services/ogAdmServer/tests/units/test_0005_post_shell_output.py4
-rw-r--r--admin/Sources/Services/ogAdmServer/tests/units/test_0006_post_session.py4
-rw-r--r--admin/Sources/Services/ogAdmServer/tests/units/test_0007_post_poweroff.py4
-rw-r--r--admin/Sources/Services/ogAdmServer/tests/units/test_0008_post_reboot.py4
-rw-r--r--admin/Sources/Services/ogAdmServer/tests/units/test_0009_post_stop.py4
-rw-r--r--admin/Sources/Services/ogAdmServer/tests/units/test_0010_post_refresh.py4
-rw-r--r--admin/Sources/Services/ogAdmServer/tests/units/test_0011_post_hardware.py4
-rw-r--r--admin/Sources/Services/ogAdmServer/tests/units/test_0012_post_software.py4
11 files changed, 44 insertions, 0 deletions
diff --git a/admin/Sources/Services/ogAdmServer/tests/units/test_0002_post_clients.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0002_post_clients.py
index 1aae349e..590d6bab 100644
--- a/admin/Sources/Services/ogAdmServer/tests/units/test_0002_post_clients.py
+++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0002_post_clients.py
@@ -12,5 +12,9 @@ class TestPostClientsMethods(unittest.TestCase):
returned = requests.post(self.url, headers=self.headers, json=self.json)
self.assertEqual(returned.status_code, 200)
+ def test_no_payload(self):
+ returned = requests.post(self.url, headers=self.headers, json=None)
+ self.assertEqual(returned.status_code, 400)
+
if __name__ == '__main__':
unittest.main()
diff --git a/admin/Sources/Services/ogAdmServer/tests/units/test_0003_post_wol.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0003_post_wol.py
index e997aff6..a1afe95f 100644
--- a/admin/Sources/Services/ogAdmServer/tests/units/test_0003_post_wol.py
+++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0003_post_wol.py
@@ -13,6 +13,10 @@ class TestPostWolMethods(unittest.TestCase):
returned = requests.post(self.url, headers=self.headers, json=self.json)
self.assertEqual(returned.status_code, 200)
+ def test_no_payload(self):
+ returned = requests.post(self.url, headers=self.headers, json=None)
+ self.assertEqual(returned.status_code, 400)
+
def test_get(self):
returned = requests.get(self.url, headers=self.headers)
self.assertEqual(returned.status_code, 405)
diff --git a/admin/Sources/Services/ogAdmServer/tests/units/test_0004_post_shell_run.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0004_post_shell_run.py
index 0dd03c10..929565cc 100644
--- a/admin/Sources/Services/ogAdmServer/tests/units/test_0004_post_shell_run.py
+++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0004_post_shell_run.py
@@ -14,6 +14,10 @@ class TestPostShellRunMethods(unittest.TestCase):
returned = requests.post(self.url, headers=self.headers, json=self.json)
self.assertEqual(returned.status_code, 200)
+ def test_no_payload(self):
+ returned = requests.post(self.url, headers=self.headers, json=None)
+ self.assertEqual(returned.status_code, 400)
+
def test_get(self):
returned = requests.get(self.url, headers=self.headers)
self.assertEqual(returned.status_code, 405)
diff --git a/admin/Sources/Services/ogAdmServer/tests/units/test_0005_post_shell_output.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0005_post_shell_output.py
index 1c6f7a3a..ea44ab6b 100644
--- a/admin/Sources/Services/ogAdmServer/tests/units/test_0005_post_shell_output.py
+++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0005_post_shell_output.py
@@ -12,6 +12,10 @@ class TestPostShellOutputMethods(unittest.TestCase):
returned = requests.post(self.url, headers=self.headers, json=self.json)
self.assertEqual(returned.status_code, 200)
+ def test_no_payload(self):
+ returned = requests.post(self.url, headers=self.headers, json=None)
+ self.assertEqual(returned.status_code, 400)
+
def test_get(self):
returned = requests.get(self.url, headers=self.headers)
self.assertEqual(returned.status_code, 405)
diff --git a/admin/Sources/Services/ogAdmServer/tests/units/test_0006_post_session.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0006_post_session.py
index 544ae2ab..95e181a5 100644
--- a/admin/Sources/Services/ogAdmServer/tests/units/test_0006_post_session.py
+++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0006_post_session.py
@@ -13,6 +13,10 @@ class TestPostSessionMethods(unittest.TestCase):
returned = requests.post(self.url, headers=self.headers, json=self.json)
self.assertEqual(returned.status_code, 200)
+ def test_no_payload(self):
+ returned = requests.post(self.url, headers=self.headers, json=None)
+ self.assertEqual(returned.status_code, 400)
+
def test_get(self):
returned = requests.get(self.url, headers=self.headers)
self.assertEqual(returned.status_code, 405)
diff --git a/admin/Sources/Services/ogAdmServer/tests/units/test_0007_post_poweroff.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0007_post_poweroff.py
index d2d5b15d..bbf9bf96 100644
--- a/admin/Sources/Services/ogAdmServer/tests/units/test_0007_post_poweroff.py
+++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0007_post_poweroff.py
@@ -12,6 +12,10 @@ class TestPostPoweroffMethods(unittest.TestCase):
returned = requests.post(self.url, headers=self.headers, json=self.json)
self.assertEqual(returned.status_code, 200)
+ def test_no_payload(self):
+ returned = requests.post(self.url, headers=self.headers, json=None)
+ self.assertEqual(returned.status_code, 400)
+
def test_get(self):
returned = requests.get(self.url, headers=self.headers)
self.assertEqual(returned.status_code, 405)
diff --git a/admin/Sources/Services/ogAdmServer/tests/units/test_0008_post_reboot.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0008_post_reboot.py
index 5ac4dc24..5d4ae061 100644
--- a/admin/Sources/Services/ogAdmServer/tests/units/test_0008_post_reboot.py
+++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0008_post_reboot.py
@@ -12,6 +12,10 @@ class TestPostRebootMethods(unittest.TestCase):
returned = requests.post(self.url, headers=self.headers, json=self.json)
self.assertEqual(returned.status_code, 200)
+ def test_no_payload(self):
+ returned = requests.post(self.url, headers=self.headers, json=None)
+ self.assertEqual(returned.status_code, 400)
+
def test_get(self):
returned = requests.get(self.url, headers=self.headers)
self.assertEqual(returned.status_code, 405)
diff --git a/admin/Sources/Services/ogAdmServer/tests/units/test_0009_post_stop.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0009_post_stop.py
index 7aa96ff8..4f6e2bf7 100644
--- a/admin/Sources/Services/ogAdmServer/tests/units/test_0009_post_stop.py
+++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0009_post_stop.py
@@ -12,6 +12,10 @@ class TestPostStopMethods(unittest.TestCase):
returned = requests.post(self.url, headers=self.headers, json=self.json)
self.assertEqual(returned.status_code, 200)
+ def test_no_payload(self):
+ returned = requests.post(self.url, headers=self.headers, json=None)
+ self.assertEqual(returned.status_code, 400)
+
def test_get(self):
returned = requests.get(self.url, headers=self.headers)
self.assertEqual(returned.status_code, 405)
diff --git a/admin/Sources/Services/ogAdmServer/tests/units/test_0010_post_refresh.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0010_post_refresh.py
index 745bdbe5..5d4dc811 100644
--- a/admin/Sources/Services/ogAdmServer/tests/units/test_0010_post_refresh.py
+++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0010_post_refresh.py
@@ -12,6 +12,10 @@ class TestPostRefreshMethods(unittest.TestCase):
returned = requests.post(self.url, headers=self.headers, json=self.json)
self.assertEqual(returned.status_code, 200)
+ def test_no_payload(self):
+ returned = requests.post(self.url, headers=self.headers, json=None)
+ self.assertEqual(returned.status_code, 400)
+
def test_get(self):
returned = requests.get(self.url, headers=self.headers)
self.assertEqual(returned.status_code, 405)
diff --git a/admin/Sources/Services/ogAdmServer/tests/units/test_0011_post_hardware.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0011_post_hardware.py
index 6d9c16a9..1a620d19 100644
--- a/admin/Sources/Services/ogAdmServer/tests/units/test_0011_post_hardware.py
+++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0011_post_hardware.py
@@ -12,6 +12,10 @@ class TestPostHardwareMethods(unittest.TestCase):
returned = requests.post(self.url, headers=self.headers, json=self.json)
self.assertEqual(returned.status_code, 200)
+ def test_no_payload(self):
+ returned = requests.post(self.url, headers=self.headers, json=None)
+ self.assertEqual(returned.status_code, 400)
+
def test_get(self):
returned = requests.get(self.url, headers=self.headers)
self.assertEqual(returned.status_code, 405)
diff --git a/admin/Sources/Services/ogAdmServer/tests/units/test_0012_post_software.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0012_post_software.py
index 1b41a868..15746836 100644
--- a/admin/Sources/Services/ogAdmServer/tests/units/test_0012_post_software.py
+++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0012_post_software.py
@@ -14,6 +14,10 @@ class TestPostSoftwareMethods(unittest.TestCase):
returned = requests.post(self.url, headers=self.headers, json=self.json)
self.assertEqual(returned.status_code, 200)
+ def test_no_payload(self):
+ returned = requests.post(self.url, headers=self.headers, json=None)
+ self.assertEqual(returned.status_code, 400)
+
def test_get(self):
returned = requests.get(self.url, headers=self.headers)
self.assertEqual(returned.status_code, 405)