From 65cc7c17e231ed10b93dce6e0e8e998f66ba0212 Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Wed, 13 Nov 2019 12:57:57 +0100 Subject: #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 --- tests/units/test_0005_post_shell_output.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/units/test_0005_post_shell_output.py') diff --git a/tests/units/test_0005_post_shell_output.py b/tests/units/test_0005_post_shell_output.py index 1c6f7a3..ea44ab6 100644 --- a/tests/units/test_0005_post_shell_output.py +++ b/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) -- cgit v1.2.3-18-g5258