summaryrefslogtreecommitdiffstats
path: root/tests/units
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2019-09-18 12:59:16 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2019-09-18 17:40:41 +0200
commit55edb404b754c3dd817289e35d67505a476e7dbf (patch)
tree38bf68ba4803dfcea163a25901ced19dac51f858 /tests/units
parent72b6c26a49c61154af268383e42d3a0e351e1035 (diff)
#915: Fix incorrect method and code in invalid GET requests
Some tests should perform GET requests however they incorrectly use POST. Return codes for these tests have also been fixed.
Diffstat (limited to 'tests/units')
-rw-r--r--tests/units/test_0003_post_wol.py4
-rw-r--r--tests/units/test_0004_post_shell_run.py4
-rw-r--r--tests/units/test_0005_post_shell_output.py4
-rw-r--r--tests/units/test_0006_post_session.py4
4 files changed, 8 insertions, 8 deletions
diff --git a/tests/units/test_0003_post_wol.py b/tests/units/test_0003_post_wol.py
index a3750f2..e997aff 100644
--- a/tests/units/test_0003_post_wol.py
+++ b/tests/units/test_0003_post_wol.py
@@ -14,8 +14,8 @@ class TestPostWolMethods(unittest.TestCase):
self.assertEqual(returned.status_code, 200)
def test_get(self):
- returned = requests.post(self.url, headers=self.headers)
- self.assertEqual(returned.status_code, 404)
+ returned = requests.get(self.url, headers=self.headers)
+ self.assertEqual(returned.status_code, 405)
if __name__ == '__main__':
unittest.main()
diff --git a/tests/units/test_0004_post_shell_run.py b/tests/units/test_0004_post_shell_run.py
index 7be1fa9..2a330be 100644
--- a/tests/units/test_0004_post_shell_run.py
+++ b/tests/units/test_0004_post_shell_run.py
@@ -13,8 +13,8 @@ class TestPostShellRunMethods(unittest.TestCase):
self.assertEqual(returned.status_code, 200)
def test_get(self):
- returned = requests.post(self.url, headers=self.headers)
- self.assertEqual(returned.status_code, 404)
+ returned = requests.get(self.url, headers=self.headers)
+ self.assertEqual(returned.status_code, 405)
if __name__ == '__main__':
unittest.main()
diff --git a/tests/units/test_0005_post_shell_output.py b/tests/units/test_0005_post_shell_output.py
index 622e482..1c6f7a3 100644
--- a/tests/units/test_0005_post_shell_output.py
+++ b/tests/units/test_0005_post_shell_output.py
@@ -13,8 +13,8 @@ class TestPostShellOutputMethods(unittest.TestCase):
self.assertEqual(returned.status_code, 200)
def test_get(self):
- returned = requests.post(self.url, headers=self.headers)
- self.assertEqual(returned.status_code, 404)
+ returned = requests.get(self.url, headers=self.headers)
+ self.assertEqual(returned.status_code, 405)
if __name__ == '__main__':
unittest.main()
diff --git a/tests/units/test_0006_post_session.py b/tests/units/test_0006_post_session.py
index 0b733d9..544ae2a 100644
--- a/tests/units/test_0006_post_session.py
+++ b/tests/units/test_0006_post_session.py
@@ -14,8 +14,8 @@ class TestPostSessionMethods(unittest.TestCase):
self.assertEqual(returned.status_code, 200)
def test_get(self):
- returned = requests.post(self.url, headers=self.headers)
- self.assertEqual(returned.status_code, 404)
+ returned = requests.get(self.url, headers=self.headers)
+ self.assertEqual(returned.status_code, 405)
if __name__ == '__main__':
unittest.main()