Commit Graph

251 Commits

Author SHA1 Message Date
Turtle
ad078cf3af Test get_all_appointments e2e 2020-04-17 15:29:01 -04:00
Turtle
b6b95a9821 Add get_all_appointments cli command 2020-04-17 15:17:11 -04:00
Sergi Delgado Segura
dcb221ea36 Adds missing cli register test 2020-04-03 20:57:01 +02:00
Sergi Delgado Segura
10e856ae74 Fixes typos according to the review 2020-04-03 16:38:46 +02:00
Sergi Delgado Segura
fe73ee7298 Fixes comments, docstrings and some renamings 2020-04-02 15:20:09 +02:00
Sergi Delgado Segura
099ec5d1ce PEP8 fixes 2020-04-02 10:02:50 +02:00
Sergi Delgado Segura
7abb4ada00 Updates AppoitmentDBM unit tests and adds UserDBM's 2020-04-01 21:30:34 +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
0e392d1f2a Cryptographer.sigrec_decode assumed signatures where properly encoded.
- Fixes a bug in sigrec_decode where the decoding function assumend that the first by was formatted as 31 + SigRec. Non properly encoded signatures made the function to crash due to an overflow (int_to_bytes(x) for negative x)
2020-04-01 17:04:33 +02:00
Sergi Delgado Segura
2d67fe8638 rpc_passwd -> rpc_password. The former can be confusing since the bitcoind parameter is rpcpassword. Avoiding that. 2020-04-01 11:14:20 +02:00
Sergi Delgado Segura
0364dba5ca Fixes e2e tests to match the user authentication apporach
Last two tests are patched, user data must be stored between restarts
2020-03-31 16:56:52 +02:00
Sergi Delgado Segura
bf0ae36940 Removes old commented code 2020-03-31 16:55:40 +02:00
Sergi Delgado Segura
502f507b21 Adds missing size field in Builder when loading data from the database 2020-03-31 15:00:30 +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
31a25f3f60 Adds unit tests for register, and adaps existing tests to match the changes in the commands 2020-03-30 22:24:20 +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
f55e37b0fc Adds unit test for watcher.get_appointment_summary 2020-03-30 16:22:52 +02:00
Sergi Delgado Segura
709a40dc64 Fixes gatekeeper and common/tools tests according to 33966e59e1 2020-03-30 13:08:24 +02:00
Sergi Delgado Segura
02fd2e5149 Adds gatekeeper unit tests 2020-03-27 17:28:12 +01:00
Sergi Delgado Segura
ae68cd33da Captures TypeErrors in Cryptographer.get_compressed_pk and adds unit tests 2020-03-27 16:50:47 +01: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
772f634d1f Sets MAX_APPOINTMENTS for Watcher unit tests to a small testable value (100) 2020-03-27 14:57:19 +01:00
Sergi Delgado Segura
f9a3315cec Updates API unit tests 2020-03-27 12:08:04 +01:00
Sergi Delgado Segura
2fcdc7eacc Removes public key from add_appointment requests 2020-03-26 19:06:39 +01:00
Sergi Delgado Segura
5d46049f31 Adapts Watcher unit tests to the new uuid apporach 2020-03-26 19:06:38 +01:00
Sergi Delgado Segura
4a8bd92144 Addapt Inspector unit tests to handle exceptions 2020-03-26 19:06:38 +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
Bjarne Magnussen
8ef7b44fd0 cli: fixes testing for ConnectionError in get_appointment 2020-03-24 18:25:32 +01:00
Sergi Delgado Segura
4071a689af Updates e2e to match 635da6447d887d7df9387e1eda63eda2e9a7d577 2020-03-23 17:15:46 +01:00
Sergi Delgado Segura
f5edaf1bf0 Fixes default HOST to remove the schema from config
The schema now defaults to http if none is defined. Also improves some of the cli docstrings
2020-03-23 17:15:43 +01:00
Sergi Delgado Segura
02eefd5807 Moves extend paths from tools to ConfigLoader 2020-03-23 13:04:50 +01:00
Sergi Delgado Segura
e2ce7ae1a4 Adds missing ConfigLoader unit tests 2020-03-23 12:35:29 +01:00
Sergi Delgado Segura
bc9c1a37f2 Properly sets conf for e2e on bitcoin-cli
bitcoin-cli on e2e tests was getting the conf straight from the default, but on circle-cli it should be data from the conf file. Setting it right.
2020-03-23 12:06:49 +01:00
Sergi Delgado Segura
d622827de8 Changes e2e teos config file format and updates circleci conf 2020-03-23 11:33:35 +01:00
Sergi Delgado Segura
01ad0d4cdf Adds some ConfigLoader unit tests 2020-03-23 11:16:32 +01:00
Sergi Delgado Segura
e9f442d419 Refactors e2e tests to match the new config approach 2020-03-21 22:52:38 +01:00
Sergi Delgado Segura
2587e25637 Adds cli unit tests 2020-03-21 22:13:33 +01:00
Sergi Delgado Segura
00a48ce6f5 Modifies ConfigParser so config file is passed as parameter (to be used by both teos and cli)
- Modifies ConfigParser
- Adapts __init__ and teosd at teos/
2020-03-21 22:02:46 +01:00
Sergi Delgado Segura
d860c9bca6 Refactor common/test_tools to remove the conf related functionality 2020-03-21 20:46:19 +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
5e5ff0278a Removes apps folder 2020-03-18 12:09:58 +01:00
Sergi Delgado Segura
a9e7eeb7f5 Reenables keys in e2e and removes monkeypatching 2020-03-18 00:19:48 +01:00
Sergi Delgado Segura
d18944e2ba Add more contrains to load_keys and updates unit tests 2020-03-17 20:22:03 +01:00
Sergi Delgado Segura
66da6c6327 Missing files to rename 2020-03-17 19:37:05 +01:00