Commit Graph

18 Commits

Author SHA1 Message Date
Sergi Delgado Segura
c384bc78c2 Changes code to use bitcoin_cli from pisa/tools 2019-11-07 19:16:18 +00:00
Sergi Delgado Segura
20f296c9d4 Reformats code to match code guidelines 2019-11-07 15:47:35 +00:00
Sergi Delgado Segura
8174ec61af Generalizes get_dummy_appointment (there were multiple instances of it in different tests)
Also refactors some unused imports and modifies the watcher tests to use .serialize instead of to_json
2019-11-07 15:08:06 +00:00
Sergi Delgado Segura
a6b1f96aaf Adds dummy appointment and job methods to conftest and includes triggered param to test_api 2019-11-05 19:11:58 +00:00
Sergi Delgado Segura
65bead3ef7 Uses bitcoin-cli instead of the api for getblockcount 2019-11-02 21:17:35 -07:00
Sergi Delgado Segura
62a68c99cb Fixes #53 2019-10-29 15:20:23 -07:00
Sergi Delgado Segura
dfaec51a3b Updates tests to dissable logging based on 17e6066 2019-10-28 14:49:52 -07:00
Sergi Delgado Segura
52f52f57f8 Apply requested changes
- Adds a PRG based on a hardcoded seed to make the tests reproducible (get_random_value_hex)
- Updates all the tests replacing urandom for get_random_value_hex
- Properly places misplaced bitcoin_cli in bitcoin_sim_tests
- Typos
2019-10-23 12:40:25 +01:00
Sergi Delgado Segura
af0e9c81b5 Adds some missing tests 2019-10-22 16:38:28 +01:00
Sergi Delgado Segura
6735aac094 Update tests to use bitcoind_sim event-wise
Also clean son unused imports
2019-10-17 19:08:34 +01:00
Sergi Delgado Segura
95759793ba Fixes bitcoin_cli
bitcoin_cli as a global variable in the main __init__.py was creating issues related to http.client.CannotSendRequest: Request-sent and connection re-usage. Define a new connection per request.
2019-10-17 17:17:52 +01:00
Sergi Delgado Segura
d43ab76220 Updates conftest fixtures so they do not autorun
The modules that need to run either bitcoind or the api do now reference to the fixture in the first test that needs it. Since the fixtures are definexd session-wise the rest of the modules will have access to them from that point on.
2019-10-14 13:19:54 +01:00
Sergi Delgado Segura
abe359f7d1 Fixes test to work with session fixtures
Test were running fine standalone but failing / having Address reuse issues when running all together. Fixing that.
2019-10-14 13:00:21 +01:00
Salvatore Ingala
9f25ef8603 Fixes from PR review 2019-10-10 18:22:33 +07:00
Sergi Delgado Segura
8b62ff9e56 Update some comments/todos/discuss 2019-10-09 17:38:15 +01:00
Sergi Delgado Segura
e0d0818f6b Removes unused code 2019-10-09 15:32:56 +01:00
Sergi Delgado Segura
e7530a53dc Fixes unconsistent test
test_get_all_appointments_responder was failing unconsistently. It was due to how the api fixture was set up.

Fix:
	- Sets up bitcoind and api fixtures to run session-wise (so they are not re-initialized for every test
	- Updates tests accordingly (e.g. reduces the number of MULTIPLE_REQUESTS so it does not cap)
	- Keeps track of all sent appointments so the test_request functionds don't need to create additional ones
2019-10-09 14:01:43 +01:00
Sergi Delgado Segura
e81ccd39a1 Adds API unit tests and modifies bitcoin_sim to be fixture compatible
- Adds unit tests for API
- Updates API to let BlockProcessor deal with block block related JSON-RPC
- Fixes BlockProcessor get_potential_matches return
- Makes bitcoin_sim runnable via function (instead of a main runnable script) to work with pytests fixture
- <3 Fixture
2019-10-08 18:55:27 +01:00