Sergi Delgado Segura
386642ff42
Adds checks of add_appointment returning current block
2020-05-22 14:18:37 +02:00
Sergi Delgado Segura
708f2e1f3b
teos - Changes the behavior for updates of already triggered appointments
...
If an update for an already triggered appointment is received, it will be drop no matter if the locator is in the cache or not. This tries to prevent inconsistencies between the Watcher and the Responder, specially in the case of a reorg when data may have to flow backwards.
2020-05-21 19:37:33 +02:00
Sergi Delgado Segura
3228eeac6b
tests - Adds LocatorCache unittests and updates existing ones to match
2020-05-21 17:06:20 +02:00
Sergi Delgado Segura
88c19d5a0d
teos - moves errors to common so it can be used by clients
2020-04-29 13:03:39 +02:00
Sergi Delgado Segura
75ca281cc4
api - updates errors and separates error from message in api errors responses
2020-04-27 19:51:38 +02:00
Sergi Delgado Segura
5f7a909804
user_pk/client_pk -> user_id and cli/client -> user (when it does not reffer to the software)
2020-04-21 19:05:20 +02:00
Sergi Delgado Segura
eea12a695e
Improves API returns for 404 and extends tests to cover it
2020-04-20 17:58:40 +02:00
Sergi Delgado Segura
eb8ffb4916
Adaps unit tests. Speeds up tests by removing unnecesary sleeps
2020-04-20 17:58:40 +02:00
Sergi Delgado Segura
71507d4c32
Gets rid of blob classes. Close #66
2020-04-20 17:30:16 +02:00
Sergi Delgado Segura
bed21e9625
Adds API HOST and PORT as configurable parameters.
...
Uses API_BIND/API_PORT for the server and API_CONNECT/API_PORT for the user, for consistency.
2020-04-20 17:01:55 +02:00
Sergi Delgado Segura
10e856ae74
Fixes typos according to the review
2020-04-03 16:38:46 +02:00
Sergi Delgado Segura
099ec5d1ce
PEP8 fixes
2020-04-02 10:02:50 +02:00
Sergi Delgado Segura
f31f356a1a
Adapts tests to use userDB and registered_users content as dict
2020-04-01 18:27:27 +02:00
Sergi Delgado Segura
4a3f4bc522
Addapts tests to match 7031b552f7. Improves DBManager tests.
2020-04-01 17:19:41 +02:00
Sergi Delgado Segura
b56123055d
Adds flake8 and fixes style issues
2020-03-31 13:06:44 +02:00
Sergi Delgado Segura
03c8ad8c87
Improves API testing. Mocks data moving from Watcher/Responder instead of running them in the background. Closes #77 .
2020-03-31 11:07:01 +02:00
Sergi Delgado Segura
746a78542f
Adds missing tests to API and improves API testing by properly mocking the requests. Closes #77
2020-03-30 22:16:39 +02:00
Sergi Delgado Segura
9ecf98e0c5
Adds tests for appointments updates of different sizes
2020-03-30 22:16:21 +02:00
Sergi Delgado Segura
93a389508e
Adds checks of decreasing slots for added appointments
2020-03-30 16:35:45 +02:00
Sergi Delgado Segura
7e6a4849e6
Adds register unit tests, missing add and get appointment tests and sets MAX_APPOINTMENTS to 100 for testing
2020-03-27 14:58:35 +01:00
Sergi Delgado Segura
f9a3315cec
Updates API unit tests
2020-03-27 12:08:04 +01:00
Sergi Delgado Segura
519caec29a
Adds basic register logic
...
- Adds register endpoint in the API
- Adds the Gatekeeper to keep track of registered user and allow/reject access
- Adds registration errors
- Updates API unit tests
- Refactors some methods of the API to reduce code replication
2020-03-25 12:14:12 +01:00
Sergi Delgado Segura
dd53ad68fb
Fixes bug when dealing with empty JSON requests or empty appointment field
...
When posting a request via requests.post the json field was dumped to json, but it shouldn't have been since requests deals with this internally. That meant that the requests made by the code didn't match proper JSON.
In line with this, the API was only parsing this type POST requests correctly, making add_appointment to fail if a proper formatted JSON was passed.
On top of that, empty appointments were not checked in the Inspector before trying to get data from them, making it crash if a JSON was posted to add_appointment not containing the `appointment` field. Unit tests for this should be added.
2020-03-24 20:17:03 +01:00
Sergi Delgado Segura
6ee04bd303
Sets add_appointment_endpoint from / to /add_appointment for consistency
...
Also passes the base_url to add_appointment and get_appointment and builds the full endpoint inside (also for consistency)
2020-03-24 19:03:41 +01:00
Sergi Delgado Segura
cb79e51d09
Refactors the tests to match the new class definitions and config formats
2020-03-20 21:38:29 +01:00
Sergi Delgado Segura
7c7ff909d7
pisa -> teos
2020-03-17 15:47:38 +01:00