Commit Graph

36 Commits (080f8edc8ea77d95b773aff9b85eb071d7288220)

Author SHA1 Message Date
Nguyễn Gia Phong 080f8edc8e Use trio.lowlevel instead of trio.hazmat
Since trio 0.15.0, hazmat has been deprecated.

trio-typing and mypy are bumped to support newer trio and each other.
2021-02-23 22:02:34 +07:00
mhchia 13e8f496a7
Noise: add noise option in the factories and tests 2020-02-28 15:50:01 +08:00
mhchia ddbedc6c15
Pubsub: `handle_talk`
- Change from async function to sync
- Change the name to `notify_subscriptions`, which is clearer.
2020-02-05 21:44:33 +08:00
mhchia 7f8c0f11f6
Pubsub: change channel size
To `32` to conform to the go implementation.
2020-02-05 21:30:26 +08:00
mhchia 095a848f30
Add clean-up logics into TrioSubscriptionAPI
Register an `unsubscribe_fn` when initializing the TrioSubscriptionAPI.
`unsubscribe_fn` is called when subscription is unsubscribed.
2020-01-28 00:29:05 +08:00
mhchia 6c7aa30191
Add events in Pubsub
To ensure `handle_peer_queue` and `handle_dead_peer_queue` are indeed
run before the tests finish. Previously, we get errors when performing
`iter_dag` after cancellation. This is because `handle_peer_queue` or
`handle_dead_peer_queue` is not actually run before the Service is
cancelled.
2020-01-18 00:17:30 +08:00
mhchia 6ae3f5dc1b
Add checkpoints in tests 2019-12-24 21:28:37 +08:00
mhchia ce5663705f
Merge branch 'master' into feature/porting-to-trio 2019-12-24 02:19:43 +08:00
mhchia 47d10e186f
Add `SubscriptionAPI`
And `TrioSubscriptionAPI`, to make subscription io-agnostic.
2019-12-17 18:17:28 +08:00
mhchia 1929f307fb
Fix all modules except for security 2019-12-06 17:06:37 +08:00
mhchia e9ab0646e3
Fix Pubsub 2019-12-03 17:27:49 +08:00
Alex Stokes 63fd531ed0
Fixes to add python 3.6 compatibility 2019-12-02 16:33:32 -08:00
NIC619 1c54c38ca7
Fix lint and add `signing_strict` to interop tests 2019-11-29 17:24:40 +08:00
NIC619 f4e86b1172
Add tests for failed signature validation cases 2019-11-29 14:13:07 +08:00
NIC619 d5d6962dce
Update Pubsub fixture and test 2019-11-27 17:15:24 +08:00
Chih Cheng Liang bcd7890124
Move test utilities to tools (#356)
* move test factories to libp2p/tools

* remove unused inits

* move pubsub test utils to tools

* cleanup test_interop

* fix typing libp2p/tools/utils

* add typing to pubsub utils

* fix factories typing

* fix typing for floodsub_integration_test_settings

* fix rest of the typing

* fix isort
2019-11-21 11:47:54 +08:00
mhchia 5307c0506b
Change `IMuxedConn` to `INetConn` in `Notifee` 2019-09-19 16:31:41 +08:00
mhchia 677531db76
Fix pubsub tests 2019-09-04 15:33:07 +08:00
mhchia 3717dc9adf
Add helper functions 2019-09-02 21:01:13 +08:00
Alex Stokes 3debd2c808
Run `black` and `isort` w/ the new config 2019-08-13 14:36:42 -07:00
NIC619 a1dc68ab70
Apply PR feedback:
add validation failed test to `push_msg` test
2019-08-07 11:53:54 +08:00
NIC619 1cea1264a4
Raise exception when topic validation failed 2019-08-06 12:38:31 +08:00
NIC619 b96ef0e6c7
Fix:
`_is_subscribed_to_msg` need only subscribe to one of the topics
2019-08-05 18:20:04 +08:00
NIC619 e1b86904e3
Add `validate_msg` and test 2019-08-05 18:19:32 +08:00
NIC619 f8ca4fa1ef
Add `get_msg_validators` and test 2019-08-05 18:19:32 +08:00
NIC619 1ed14d0cc8
Add `remove_topic_validator` test 2019-08-05 18:19:32 +08:00
NIC619 cf69f7e800
Rename to `set_topic_validator` and add test 2019-08-05 18:19:31 +08:00
Alex Stokes 7477b29508 run black w/ extended line length 2019-08-04 12:37:41 +08:00
Alex Stokes c8005c8113 Run `isort` in repo 2019-08-03 17:50:14 +08:00
mhchia 2e94fcf56c
Remove pylint:disable 2019-08-02 23:26:06 +08:00
NIC619 cd684aad9e
Update peer_id to type peer.ID in pubsub folder 2019-08-02 14:45:23 +08:00
Alex Stokes 0ae9840928
Run `black` over repo 2019-07-31 15:00:12 -07:00
mhchia 9683d5e8ac
Add tests for `Pubsub`
- `test_handle_subscription`
- `test_handle_talk`
- `test_message_all_peers`
2019-07-31 14:15:11 +08:00
mhchia 037b95252d
Add tests for `Pubsub`
- `test_get_hello_packet`
- `test_continuously_read_stream`
- `test_publish`
- `test_push_msg`
2019-07-31 14:15:10 +08:00
mhchia 550289a439
Combine test_subscription.py to test_pubsub.py
And add a bunch of tests for pubsub
2019-07-31 14:15:10 +08:00
mhchia 96563c0d84
Add fixtures for pubsub and router
And a starting `test_pubsub.py`
2019-07-31 14:14:13 +08:00