Commit graph libervia-backend/tests
Author SHA1 Message Date
Goffi
91f6b77b3d refactoring: rename core.sat_main to core.main 2023-06-02 12:59:21 +02:00
Goffi
af1c203450 refactoring: rename SAT class to LiberviaBackend 2023-06-02 11:55:48 +02:00
Goffi
d2685ba11b refactoring: renamed sat package to libervia.backend 2023-06-02 11:49:51 +02:00
Goffi
f92c1f2ac6 tests (unit): Skip XEP-0373 test if gpg can't be imported 2023-06-01 21:37:34 +02:00
Goffi
c92762858f tests (units): tests for plugin XEP-0339:
fix 439
2023-06-01 21:37:31 +02:00
Goffi
ce8623dc97 tests (units): tests for plugin XEP-0338:
fix 440
2023-05-30 22:23:37 +02:00
Goffi
e98d39990b tests (units): tests for plugin XEP-0294:
fix 438
2023-05-30 17:58:44 +02:00
Goffi
76c8015212 tests (units): tests for plugin XEP-0293:
fix 437
2023-05-29 17:58:05 +02:00
Goffi
52547edb15 tests (units): tests for plugin XEP-0167:
fix 420
2023-05-29 13:38:11 +02:00
Goffi
791544ec54 tests (unit): XEP-0320 tests:
fix 421
2023-05-15 17:02:41 +02:00
Goffi
bd675233cb tests (unit): tests for plugin XEP-0176:
fix 419
2023-05-15 16:23:50 +02:00
Goffi
6a6f15707a massive refactoring to switch from camelCase to snake_case:
historically, Libervia (SàT before) was using camelCase as allowed by PEP8 when using a
pre-PEP8 code, to use the same coding style as in Twisted.

However, snake_case is more readable and it's better to follow PEP8 best practices, so it
has been decided to move on full snake_case. Because Libervia has a huge codebase, this
ended with a ugly mix of camelCase and snake_case.

To fix that, this patch does a big refactoring by renaming every function and method
(including bridge) that are not coming from Twisted or Wokkel, to use fully snake_case.

This is a massive change, and may result in some bugs.
2023-04-08 13:54:42 +02:00
Goffi
378dfea0de tests (unit): Add test for plugin XEP-0215:
rel 418
2023-04-07 15:17:24 +02:00
Goffi
52f7a2b11f component AP gateway: don't percent-encode @:
Mastodon doesn't like when "@" is percent-encoded (because it doesn't do it, and it checks
that the URL matches the ID without taking care of percent-encoding).
2023-02-10 17:20:02 +01:00
Goffi
2940ba0d35 core (main): log Exception when bridge_pi fails 2022-11-24 12:25:04 +01:00
Goffi
4d14a623fc component AP gateway: parse body immediately on POST request:
the body is parsed immediately during a `POST` request: this avoids duplication of code,
and allows to check the body data before continuing (will be used to filter some requests
in a future patch).
2022-11-15 18:07:34 +01:00
Goffi
e735ae6a58 tests (e2e/cli): test for Pubsub Targeted Encryption:
rel 382
2022-10-31 13:48:31 +01:00
Goffi
27e9655898 tests (e2e/cli): add tests for JET:
rel 378
2022-10-31 04:09:38 +01:00
Goffi
8cf01c8569 tests (e2e/cli): add a test for Pubsub Signing:
rel 381
2022-10-30 01:06:55 +02:00
Goffi
2e46d08225 tests (e2e/cli): add test for pubsub encryption:
test encryption and keys sharing.

rel 380
2022-10-15 20:38:33 +02:00
Syndace
6d1e942f43 plugin XEP-0373 and XEP-0374: Implementation of OX and OXIM:
GPGME is used as the GPG provider.

rel 374
2022-09-20 16:22:18 +02:00
Syndace
75ae8160ae plugin XEP-0384: Fully reworked to adjust to the reworked python-omemo:
- support for both (modern) OMEMO under the `urn:xmpp:omemo:2` namespace and (legacy) OMEMO under the `eu.siacs.conversations.axolotl` namespace
- maintains one identity across both versions of OMEMO
- migrates data from the old plugin
- includes more features for protocol stability
- uses SCE for modern OMEMO
- fully type-checked, linted and format-checked
- added type hints to various pieces of backend code used by the plugin
- added stubs for some Twisted APIs used by the plugin under stubs/ (use `export MYPYPATH=stubs/` before running mypy)
- core (xmpp): enabled `send` trigger and made it an asyncPoint

fix 375
2022-08-23 21:06:24 +02:00
Goffi
c2e2f0c332 tests (unit/AP gateway): add tests for events:
rel 372
2022-09-22 00:01:48 +02:00
Goffi
a206196e9d tests (unit/AP gateway): fix tests:
rel 372
2022-09-22 00:01:48 +02:00
Goffi
4d2263f54b tests (AP gateway): reactions tests:
2 new tests check XMPP <=> AP reactions conversion

rel 371
2022-08-31 17:07:03 +02:00
Goffi
85afb52968 tests (AP gateway): fix tests following changes in gateway:
- `shareInbox` is now used when available, thus tests now check for that
- `client._ap_storage` is used, thus is added to the mockClient
  `ap_const.NS_AP_PUBLIC` is now in `cc` instead of `to` field

rel 371
2022-08-31 17:07:03 +02:00
Syndace
d1b5ff0c41 plugin XEP-0420: Implementation of Stanza Content Encryption:
Includes implementation of XEP-0082 (XMPP date and time profiles) and tests for both new plugins.
Everything is type checked, linted, format checked and unit tested.
Adds new dependency xmlschema.

fix 377
2022-08-23 12:04:11 +02:00
Goffi
155c249884 tests (unit/AP gateway): tests for item repeat/announce and noticed/like conversion:
Add tests for

- XMPP blog post repeat => AP Announce conversion and vice versa
- XMPP pubsub `noticed` attachment => AP like conversion and vice versa

rel 370
2022-07-22 15:45:33 +02:00
Goffi
68d7c9257b test (unit/AP gateway): tests for XMPP reference/mention <=> AP mention conversion:
this patch add 5 tests:
- 2 to mention AP mention to XMPP conversion, with direct addressing or using "tag" field
- 2 to test automatic mention parsing of body
- 1 to test XEP-0372 Reference to AP mention conversion

rel 369
2022-07-10 16:15:09 +02:00
Goffi
a5381c8c86 tests (unit/ap-gateway): tests for XMPP identity/vCard4 <=> AP actor data conversion:
rel 368
2022-06-29 14:06:33 +02:00
Goffi
57c945dc9f tests (unit/ap gateway): message/item retractation tests:
this patch adds 4 tests to check pubsub <=> AP item retractation and message <=> AP item
retractation.

rel 367
2022-06-17 15:50:34 +02:00
Goffi
847780b473 tests (unit/ap gateway): fix onMessage call following change in the component:
the component now uses the normal message workflow, thus the tests had to be updated

rel 367
2022-06-17 15:50:34 +02:00
Goffi
4c28917466 test (unit/AP gateway): AP direct message ↔ XMPP <message> conversion:
test that AP direct messages are converted to XMPP `<message>` stanzas instead of pubsub
items.
test that XMPP `<message>` stanzas are converted to AP direct messages (i.e. items
addressed solely to the recipient, without *followers* or *public* collections).

rel 366
2022-05-24 17:57:39 +02:00
Goffi
72ec311ef1 tests (unit/ap_gateway): fix tests 2022-05-24 17:49:14 +02:00
Goffi
4d3f5f1afa tests (unit/ap-gateway): tests for following/followers <=> PPS:
AP following/followers collections to XMPP Public Pubsub Subscriptions conversion is
checked in both directions.

rel 365
2022-05-13 19:29:17 +02:00
Goffi
fca541a2f1 tests (e2e/cli/cache_search): make the test more resilient:
the caching is triggered by `li.blog.get`, but it is done in parallel without blocking the
command, thus there is a possibility that the data is not yet in cache when the following
test is done.

A loop with delay is done, to be sure that cache is filled before doing the assertion.
2022-05-13 19:27:21 +02:00
Goffi
127d383eb5 tests (ap-gateway): fix use of outbox URL to get items 2022-03-21 16:37:19 +01:00
Goffi
d1a623d12b tests (unit): AP gateway unit tests:
are covered:

- AP actor handle to XMPP JID/pubsub node
- XMPP JID/pubsub node to AP actor handle
- AP request to JID/pubsub node (AP collection to items/RSM metadata conversion)
- pubsub request to AP actor (pubsub request with RSM to AP collection/pagination requests
  conversion)

ticket 363
2022-01-31 18:35:52 +01:00
Goffi
589468041a tests (e2e/CLI/set_get): fix RSM request:
items are stored in chronological order in Pubsub, and as we want the more recent one, we
need to set `before=''`. Otherwise, we can get a wrong item from a previous test.
2022-01-31 18:35:52 +01:00
Goffi
14d00a9dda merge bookmark @ 2021-11-12 17:21:24 +01:00
Goffi
b374f17eb6 tests (e2e/web): add basic tests for generic lists 2021-11-05 18:11:24 +01:00
Goffi
b7c1579919 tests (e2e/run_e2e): fix inappropriate use of -T option 2021-11-05 18:11:24 +01:00
Goffi
041e877e48 merge bookmark @ 2021-09-08 18:00:02 +02:00
Goffi
33d452e0cc tests (e2e/CLI): tests for Pubsub Cache Search
fix 361
2021-09-08 17:58:48 +02:00
Goffi
9753dd5354 tests (e2e): print revision used in run_e2e 2021-09-08 17:57:28 +02:00
Goffi
50d7cb2a51 merge bookmark @ 2021-09-08 11:20:37 +02:00
Goffi
9293c7259d tests (e2e/cli): update JSON and XML outputs following changes in Libervia CLI 2021-09-08 11:18:01 +02:00
Goffi
29e76c1adb test (e2e/cli): use max_items instead of max when retrieving blog items:
RSM `max` alone will return first (oldest) items, while `max_items` will return latest
ones. As Libervia Pubsub as been fixed in this regard, tests are now fixed too.
2021-09-08 11:17:51 +02:00
Goffi
6b2e0649a3 tests (e2e/web): fix test files paths following global name change 2021-09-08 11:17:43 +02:00
Goffi
debbdba8eb tests (e2e): fix names in run_e2e script, following global name change. 2021-09-08 11:17:34 +02:00