diff options
Diffstat (limited to 'admin')
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) |