Commit graph libervia-backend/tests
Author SHA1 Message Date
Goffi
14dbca530b plugin XEP-0313: check message origin:
Check that "from" attribute of the forwarded message is coming from the service.
2026-08-18 18:48:04 +02:00
Goffi
c6f390df3c test: minor formatting 2026-07-17 16:45:29 +02:00
Goffi
7696afb3d8 core: uid is now set in extra in client.sendMessage:
By setting `uid` in extra, it can now be specified by frontends.
2026-07-09 17:13:37 +02:00
Goffi
be203cc73a tests (unit): Plugin XID tests:
rel 477
2026-06-06 12:33:46 +02:00
Goffi
351b7e2140 plugin XEP-0356: Fix incorrect _on_presence definition 2026-05-04 16:44:39 +02:00
Goffi
18d3f0167f plugin XEP-0115: Fix disco duplicate on caps node query + check own generation:
When caps node was requested, disco infos was returned from cache + infos from normal
disco gathering, resulting in doubled items and other entities rejecting the disco info.

This is fixed by subclassing the disco handler to add a trigger. This trigger is used by
XEP-0115 to short circuit the disco gathering and returned its cached data instead.

Our own hash is re-generated on each connection, and validated, so if there is a bug, this
helps see and catch it.
2026-05-04 16:44:39 +02:00
Goffi
dd79a42931 plugin XEP-0115: refactoring and complete implementation:
- the XEP-0115 implementation has been completed with validation, caps node handling in
  disco requests, hash generation fixes, and real support for xml:lang.
- the `generate_hash` method has been moved from disco where it's not used anymore to
  XEP-0115.
- Disco doesn't hash systematically, it nos use a per-jid cache for non XEP-0115
  supporting client.
- code modernisation, with use of `get_plugin_data` for Client data in XEP-0115, type
  hints, etc.
- More comments have been added to link algorithms steps to the relevant part in
  specification.
2026-04-18 01:08:01 +02:00
Goffi
f6db575ee4 core, dependencies: Update Tx-XMPP to 0.12:
Tx-XMPP 0.12 has beaking change in `discoFeature.identities` because it now supports
`xml:lang` attribute, so this update implies updating the code everywhere were this is
used.
2026-04-17 17:26:54 +02:00
Goffi
1548276702 test: Python 3.14 compatibility update 2026-04-17 15:27:59 +02:00
Goffi
ae841fee0e tests (unit): Rename tests for consistency 2026-04-15 23:17:53 +02:00
Goffi
42c2f88b30 component pubsub: PEP presence access model and auto-subscription
- Implement `presence` access model for PEP nodes.
- Add PEP auto-subscription (`+notify` handling)
- New `get_pep_last_items` storage method to retrieve in a single query items to send to
  auto-subscribers.
- Online resource tracking.

This completes the PEP support.

rel 476
2026-04-15 20:51:51 +02:00
Goffi
81bd3dcf01 component pubsub: PEP implementation:
New implementations of XEP-0355 and XEP-0356 are integrated to handle PEP. The
implementation is not complete yet, as auto-subscribe and presence permissions are not
implemented yet.

rel 476
2026-04-14 23:16:18 +02:00
Goffi
6605e523d0 plugin XEP-0356: Privileged Entity implementation:
This is the second XEP needed to implement PEP in Pubsub Component. This implementation
should be more or less complete.

rel 476
2026-04-14 23:08:21 +02:00
Goffi
ba9a2fc6d5 tests (unit/XEP-0338): Fix async call to xep_0338._jingle_handler_trigger 2026-04-14 23:06:12 +02:00
Goffi
f5e0152b32 plugin XEP-0355: Namespace Delegation implementation:
The admin mode is implemented. It is needed to handle PEP with Pubsub Component.

rel 476
2026-04-14 23:04:04 +02:00
Goffi
c10c34304a tests (unit/email gateway): Fix tests 2026-04-11 12:46:47 +02:00
Goffi
31b55fbbe7 tests (unit/component pubsub): Fix tests
rel 476
2026-04-11 01:55:15 +02:00
Goffi
2c3d11e7ff tests (unit): Pubsub component tests:
rel 476
2026-04-09 21:47:53 +02:00
Goffi
09bef94ffe plugin XEP-0373, tests (unit/XEP-0373): Make rpad size >= 50:
XEP-0420 bounds starts at 0 but 0-length rpad defeats its purpose (the XEP actually says
"TODO: sane boundaries?"). Furthermore, some tests where failing randomly due to 0-lenght
rpad sometimes happening. This patch makes rpad minimum size at 50.
2026-04-09 21:47:53 +02:00
Goffi
73b410aa97 tests (unit/cli/calls): Skip tests in case of missing media or webrtc:
Test were raising exceptions when optional modules were missing (GStreamer related modules
for `webrtc`). Those are now catched so the tests are simply skipped in this case.

`MissingModule` is now inheriting from `ImportError`, as it's a natural subclass, and it
makes import error catching easier.
2026-04-09 21:47:46 +02:00
Goffi
72d7868eb5 tests (unit/conftests): Add a reset_storage autouse fixture:
Storage can be modified by tests, and it is kept for the whole session, this may have side
effect resulting in other tests failing. This fixture avoid this problem by reseting
`storage` between each test.
2026-04-09 21:47:43 +02:00
Goffi
0cfeea8203 tests (unit/conftest): bridge is now a read-only property, update _bridge instead. 2026-04-09 21:47:07 +02:00
Goffi
68da01a043 Dates update. 2026-03-31 12:57:17 +02:00
Goffi
51776603e0 depdencies, core: update Tx-XMPP to be version >= 10.0:
This version changes the package name, so all `wokkel` imports habe been replaced by
`tx_xmpp`
2026-03-24 16:42:27 +01:00
Goffi
82e2c6efac apply black to the whole codebase. 2026-03-09 09:22:04 +01:00
Goffi
b4a13ce51e tests (unit): Add tests for pubsub contacts:
Tests the models and plugin data behaviour.

rel 475
2026-02-23 13:15:16 +01:00
Goffi
c5396f0acf backend: Tor integration:
- Add the `txtorcon` optional dependency, used with `tor` extra.
- Add settings for Tor.
- Use Tor endpoint when an `.onion` XMPP domain is used, of when Tor is explicitely
  enabled in conf.
- Disable WebRTC, for now it's the safer option as WebRTC can leak IP. It should be
  possible to use it over Tor by forcing the use of a .onion relay, but this is to be
  explored later (A/V should be to slow to be usable, but that stay relevant for file
  transfer or other WebRTC powered things).
- A new `treq` instance using Tor WebAgent is used when Tor is enabled. Properties has
  been added to SatXMPPEntity to conveniently get the right instance.
- Another `tor_mode` property has been added with corresponding bridge methods, to see if
  Tor is activated and in which mode for a given profile. For now there are only two modes
  (disabled, and enabled with WebRTC disabled), but in the future it may be possible to
  activate WebRTC over Tor, or to use Tor only to connect to XMPP server, while using
  clearnet for other connections.
- Tor dedicated models have been added, and bridge methods have been added to build and
  get them.
- Fix tests.

rel 473
2025-12-15 11:35:19 +01:00
Goffi
7b3c8d2ba8 black reformatting. 2025-12-03 17:49:34 +01:00
Goffi
e68278a1ac tests (unit): Fix tests. 2025-12-03 17:43:06 +01:00
Goffi
96bf3af324 Global reformatting with black. 2025-09-13 10:46:10 +02:00
Goffi
2b9b14ba1b tests (unit/components): Add tests for email gateway's cleaning module:
rel 464
2025-09-11 21:17:51 +02:00
Goffi
14f50afa64 tests (unit/sqla): Add test for keyword filtering:
rel 458
2025-06-06 10:45:54 +02:00
Goffi
4a0d106b90 test (XEP-0461): some tests for XEP-0461:
rel 457
2025-05-06 00:34:01 +02:00
Goffi
b7f4202a78 tests (unit/email gateway): add tests for pubsub service:
rel 453
2024-12-03 00:52:06 +01:00
Goffi
91447d0c88 tests (unit): fix tests:
- test_ap-gateway: fix missing implementation of `client.is_local`
- test_plugin_xep_0215: fix missing return value of `has_feature`
2024-09-30 14:15:47 +02:00
Goffi
03e1357401 tests (unit/email gateway): add test for XEP-0131 handling:
rel 451
2024-09-28 15:59:48 +02:00
Goffi
5226323cae tests (unit): add XEP-0131 tests:
rel 451
2024-09-28 15:57:03 +02:00
Goffi
a81612f0f1 test (unit): add test for email gateway:
rel 450
2024-09-26 16:12:01 +02:00
Goffi
49a1cfe974 test (unit): add test for plugin XEP-0033:
those replace the legacy XEP-0033 test from libervia/backend/test/test_plugin_xep_0033.py.

rel 450
2024-09-26 16:12:01 +02:00
Goffi
5005ca346b tests: reformat tests using black. 2024-09-26 16:11:56 +02:00
Goffi
4f7f383687 tests (unit): add test for XEP-0298 plugin + fix XEP-0167:
fix 447
2024-07-29 03:49:26 +02:00
Goffi
067d8f32bf tests (unit): fix tests + black reformatting. 2024-07-14 17:42:53 +02:00
Goffi
b402be2a7a component AP Gateway: implement HTTP GET signature. 2024-06-05 22:34:09 +02:00
Goffi
b81a931867 tests (unit/XEP-0272): XEP-0272 tests:
fix 429
2024-05-15 17:35:16 +02:00
Goffi
f1cc67fd46 test (unit/cli): Add a file send/receive test for WebRTC:
fix 442
2024-04-06 15:21:00 +02:00
Goffi
27b66b3fb2 tests (unit/webrtc,XEP-0176, XEP-0234): Fix tests and add webrtc file transfer tests:
fix 441
2024-04-06 12:59:50 +02:00
Goffi
48201780de tests: fix and update tests:
- update code to newer version of `sh`
- update code to newer version of `selenium`
- update names of OMEMO algorithms
- fix paths and names used to mount source to the test container
- skip modules using `Gst` and `PyQt` when they are not available.
2024-03-05 17:31:56 +01:00
Goffi
039a9b5830 tests (unit): fix tests 2024-02-23 15:42:02 +01:00
Goffi
ce2d217c64 tests (unit/cli/calls): unit tests for CLI call GUI:
rel 427
2024-02-11 23:21:07 +01:00
Goffi
6a92ebce37 tests (unit/frontends): tests for webrtc implementation:
rel 426
2023-11-01 14:04:25 +01:00