evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / matrix-nio / allow-tests-without-olm.patch
blob392f163e4be9d68911c4e9a967f64e2e5294d5c1
1 diff --git a/tests/async_client_test.py b/tests/async_client_test.py
2 index b0f7a5a..2494fc6 100644
3 --- a/tests/async_client_test.py
4 +++ b/tests/async_client_test.py
5 @@ -140,7 +140,10 @@ from nio.api import (
6 ThreadInclusion,
8 from nio.client.async_client import connect_wrapper, on_request_chunk_sent
9 -from nio.crypto import OlmDevice, Session, decrypt_attachment
10 +try:
11 + from nio.crypto import OlmDevice, Session, decrypt_attachment
12 +except ImportError:
13 + pass
14 from nio.responses import PublicRoom, PublicRoomsResponse
16 BASE_URL_V1 = f"https://example.org{MATRIX_API_PATH_V1}"
17 diff --git a/tests/conftest.py b/tests/conftest.py
18 index 0c67ee0..6b77e02 100644
19 --- a/tests/conftest.py
20 +++ b/tests/conftest.py
21 @@ -10,11 +10,17 @@ from conftest_async import ( # noqa: F401
22 async_client_pair_same_user,
23 unauthed_async_client,
25 -from olm import Account
26 +try:
27 + from olm import Account
28 +except ImportError:
29 + pass
31 from nio import Client, ClientConfig, HttpClient
32 -from nio.crypto import Olm, OlmDevice
33 -from nio.store import SqliteMemoryStore
34 +try:
35 + from nio.crypto import Olm, OlmDevice
36 + from nio.store import SqliteMemoryStore
37 +except ImportError:
38 + pass
40 ALICE_ID = "@alice:example.org"
41 ALICE_DEVICE_ID = "JLAFKJWSCS"
42 diff --git a/tests/helpers.py b/tests/helpers.py
43 index 63445b6..05096d1 100644
44 --- a/tests/helpers.py
45 +++ b/tests/helpers.py
46 @@ -26,8 +26,11 @@ from hyperframe.frame import (
47 WindowUpdateFrame,
50 -from nio.crypto import OlmAccount, OlmDevice
51 -from nio.store import Ed25519Key
52 +try:
53 + from nio.crypto import OlmAccount, OlmDevice
54 + from nio.store import Ed25519Key
55 +except ImportError:
56 + pass
58 SAMPLE_SETTINGS = {
59 SettingsFrame.HEADER_TABLE_SIZE: 4096,