Roberto Hueso Gómez
c1c89e196c
#915 : Return 400 status code in POST methods when no payload is attached
...
If no payload is attached to method that requires a payload, then the API
returns a 400 status code (following RFC 7231) instead of the previous 404.
test_0001_get_clients.py is also modified to fit the new status code.
2019-09-19 16:06:03 +02:00
Roberto Hueso Gómez
55edb404b7
#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.
2019-09-18 17:40:41 +02:00
Roberto Hueso Gómez
72b6c26a49
#915 : Remove duplicated test
...
This test is already performed in test_0001_get_clients.py
2019-09-18 17:40:41 +02:00
Roberto Hueso Gómez
741524f59b
#915 : more descriptive function name in test
...
This test sends a POST with no body, which is illegal, use a function
name that describes this.
2019-09-18 17:40:41 +02:00
Javier Sánchez Parra
46d791ae44
#915 add test for too large HTTP request fields
...
This test checks for wrong headers HTTP requests:
1. POST /clients with a content length larger than a signed int.
2. POST /clients with an auth token larger than 63 characters.
2019-09-10 11:10:34 +02:00
Javier Sánchez Parra
784495f5d5
#915 adds test for too large HTTP request
...
This test checks for too large HTTP requests, for example:
POST /clients
with a body of 4096 bytes.
2019-09-04 20:13:11 +02:00
Javier Sánchez Parra
e397e7930f
#915 add missing brackets to WOL API test json
...
Without the brackets the call works (200 response) but the ogAdmServer
does not send the WOL packets.
2019-08-28 17:53:19 +02:00
Javier Sánchez Parra
8903c6819e
#915 adds tests for a non existent method
...
This test adds four new error test cases:
1. Non existent method with POST.
2. Non existent method with GET.
3. Non existent method with POST but with wrong API token.
4. Non existent method with POST but without json.
2019-07-15 09:53:40 +02:00
Javier Sánchez Parra
9c7954b4cc
#915 adds test for POST /software REST API
...
This test covers two two scenarios:
1. Correct usage.
2. Incorrect usage, use this command with GET (this returns http 405).
2019-07-15 09:51:22 +02:00
Javier Sánchez Parra
022774b255
#915 adds test for POST /hardware REST API
...
This test covers two two scenarios:
1. Correct usage.
2. Incorrect usage, use this command with GET (this returns http 405).
2019-07-15 09:51:03 +02:00
Javier Sánchez Parra
e46b09ba2c
#915 adds test for POST /refresh REST API
...
This test covers two two scenarios:
1. Correct usage.
2. Incorrect usage, use this command with GET (this returns http 405).
2019-07-15 09:50:43 +02:00
Javier Sánchez Parra
84c4544f61
#915 adds test for POST /stop REST API
...
This test covers two two scenarios:
1. Correct usage.
2. Incorrect usage, use this command with GET (this returns http 405).
2019-07-15 09:50:21 +02:00
Javier Sánchez Parra
5ea87f3c92
#915 adds test for POST /reboot REST API
...
This test covers two two scenarios:
1. Correct usage.
2. Incorrect usage, use this command with GET (this returns http 405).
2019-07-15 09:49:51 +02:00
Javier Sánchez Parra
a914462bbf
#915 adds test for POST /poweroff REST API
...
This test covers two two scenarios:
1. Correct usage.
2. Incorrect usage, use this command with GET (this returns http 405).
2019-07-15 09:49:04 +02:00
Javier Sánchez Parra
a887c7b4c8
#915 tests correct command, /session
...
This should test /shell/run instead of /session
2019-07-15 09:47:38 +02:00
Javier Sánchez Parra
880cc90c14
#915 Improve test output using unittest discover
...
* Call the tests with python module unittest. In particular, the
discover function.
* Rename tests files to meet the default requirements of discover
function.
2019-07-05 17:41:26 +02:00
Javier Sánchez Parra
eae2385f67
#915 Add API token to tests in ogAdmServer/tests/units/*
...
Add token parameter in REST API test infrastructure.
2019-06-24 13:50:43 +02:00
Javier Sánchez Parra
b35438d27e
#915 add test for POST /session REST API
2019-05-31 11:39:43 +02:00
Javier Sánchez Parra
496f5ebb49
#915 add test for POST /shell/output REST API
2019-05-31 11:39:29 +02:00
Javier Sánchez Parra
5312e73c91
#915 add test for POST /shell/run REST API
2019-05-31 11:39:06 +02:00
Javier Sánchez Parra
556aa6b858
#915 add test for POST /wol REST API
2019-05-31 11:39:01 +02:00
Javier Sánchez Parra
c39b1f324e
#915 add test for POST /clients REST API
2019-05-31 11:38:57 +02:00
Javier Sánchez Parra
1af2f4b55e
#915 add test for GET /clients REST API
2019-05-31 11:38:52 +02:00