mesh-sandbox 0.1.22__py3-none-any.whl → 0.1.23__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mesh_sandbox/__init__.py +1 -1
- mesh_sandbox/store/memory_store.py +8 -0
- mesh_sandbox/tests/admin.py +43 -10
- mesh_sandbox/tests/helpers.py +1 -1
- {mesh_sandbox-0.1.22.dist-info → mesh_sandbox-0.1.23.dist-info}/METADATA +1 -1
- {mesh_sandbox-0.1.22.dist-info → mesh_sandbox-0.1.23.dist-info}/RECORD +8 -8
- {mesh_sandbox-0.1.22.dist-info → mesh_sandbox-0.1.23.dist-info}/LICENSE +0 -0
- {mesh_sandbox-0.1.22.dist-info → mesh_sandbox-0.1.23.dist-info}/WHEEL +0 -0
mesh_sandbox/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.23"
|
|
@@ -23,6 +23,14 @@ class MemoryStore(CannedStore):
|
|
|
23
23
|
self.outboxes[mailbox_id] = []
|
|
24
24
|
self.local_ids[mailbox_id] = defaultdict(list)
|
|
25
25
|
|
|
26
|
+
# pylint: disable=attribute-defined-outside-init
|
|
27
|
+
# clear rich inbox for mailbox
|
|
28
|
+
self.messages = {
|
|
29
|
+
message_id: message
|
|
30
|
+
for message_id, message in self.messages.items()
|
|
31
|
+
if message.recipient.mailbox_id != mailbox_id
|
|
32
|
+
}
|
|
33
|
+
|
|
26
34
|
async def send_message(self, message: Message, body: bytes):
|
|
27
35
|
|
|
28
36
|
async with self.lock:
|
mesh_sandbox/tests/admin.py
CHANGED
|
@@ -5,6 +5,7 @@ import pytest
|
|
|
5
5
|
from fastapi import status
|
|
6
6
|
from fastapi.testclient import TestClient
|
|
7
7
|
|
|
8
|
+
from mesh_sandbox.common import APP_V1_JSON
|
|
8
9
|
from mesh_sandbox.tests import _CANNED_MAILBOX1, _CANNED_MAILBOX2
|
|
9
10
|
from mesh_sandbox.tests.mesh_api_helpers import (
|
|
10
11
|
mesh_api_get_inbox_size,
|
|
@@ -13,7 +14,8 @@ from mesh_sandbox.tests.mesh_api_helpers import (
|
|
|
13
14
|
mesh_api_track_message_by_message_id_status,
|
|
14
15
|
)
|
|
15
16
|
|
|
16
|
-
from .
|
|
17
|
+
from ..common.constants import Headers
|
|
18
|
+
from .helpers import generate_auth_token, temp_env_vars
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
def test_reset_canned_store_should_return_bad_request(app: TestClient):
|
|
@@ -88,16 +90,52 @@ def test_reset_memory_store_should_clear_specified_mailbox_only(app: TestClient)
|
|
|
88
90
|
res = mesh_api_track_message_by_message_id(app, _CANNED_MAILBOX2, msg_2to1_id)
|
|
89
91
|
assert res.json()["messageId"] == msg_2to1_id
|
|
90
92
|
|
|
93
|
+
res = app.get(
|
|
94
|
+
f"/messageexchange/{_CANNED_MAILBOX1}/inbox/rich?max_results=10",
|
|
95
|
+
headers={Headers.Authorization: generate_auth_token(_CANNED_MAILBOX1), Headers.Accept: APP_V1_JSON},
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
assert res.status_code == status.HTTP_200_OK
|
|
99
|
+
response = res.json()
|
|
100
|
+
messages = [res["message_id"] for res in response.get("messages", [])]
|
|
101
|
+
assert len(messages) == 1
|
|
102
|
+
|
|
103
|
+
res = app.get(
|
|
104
|
+
f"/messageexchange/{_CANNED_MAILBOX2}/inbox/rich?max_results=10",
|
|
105
|
+
headers={Headers.Authorization: generate_auth_token(_CANNED_MAILBOX2), Headers.Accept: APP_V1_JSON},
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
assert res.status_code == status.HTTP_200_OK
|
|
109
|
+
response = res.json()
|
|
110
|
+
messages = [res["message_id"] for res in response.get("messages", [])]
|
|
111
|
+
assert len(messages) == 1
|
|
112
|
+
|
|
113
|
+
# RESET mailbox 2
|
|
91
114
|
res = app.delete(f"/messageexchange/reset/{_CANNED_MAILBOX2}")
|
|
92
115
|
assert res.status_code == status.HTTP_200_OK
|
|
93
116
|
|
|
117
|
+
assert mesh_api_get_inbox_size(app, _CANNED_MAILBOX1) == 1
|
|
94
118
|
assert mesh_api_get_inbox_size(app, _CANNED_MAILBOX2) == 0
|
|
95
|
-
|
|
96
|
-
|
|
119
|
+
|
|
120
|
+
res = app.get(
|
|
121
|
+
f"/messageexchange/{_CANNED_MAILBOX1}/inbox/rich?max_results=10",
|
|
122
|
+
headers={Headers.Authorization: generate_auth_token(_CANNED_MAILBOX1), Headers.Accept: APP_V1_JSON},
|
|
97
123
|
)
|
|
98
124
|
|
|
99
|
-
assert
|
|
100
|
-
|
|
125
|
+
assert res.status_code == status.HTTP_200_OK
|
|
126
|
+
response = res.json()
|
|
127
|
+
mb1_rich_inbox_messages = [res["message_id"] for res in response.get("messages", [])]
|
|
128
|
+
assert len(mb1_rich_inbox_messages) == 1
|
|
129
|
+
|
|
130
|
+
res = app.get(
|
|
131
|
+
f"/messageexchange/{_CANNED_MAILBOX2}/inbox/rich?max_results=10",
|
|
132
|
+
headers={Headers.Authorization: generate_auth_token(_CANNED_MAILBOX2), Headers.Accept: APP_V1_JSON},
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
assert res.status_code == status.HTTP_200_OK
|
|
136
|
+
response = res.json()
|
|
137
|
+
mb2_rich_inbox_messages = [res["message_id"] for res in response.get("messages", [])]
|
|
138
|
+
assert len(mb2_rich_inbox_messages) == 0
|
|
101
139
|
|
|
102
140
|
|
|
103
141
|
@pytest.mark.parametrize("clear_disk", ["tRue", "faLse", None])
|
|
@@ -173,12 +211,7 @@ def test_reset_file_store_should_clear_specified_mailbox_only_and_maybe_files(
|
|
|
173
211
|
assert res.status_code == status.HTTP_200_OK
|
|
174
212
|
|
|
175
213
|
assert mesh_api_get_inbox_size(app, _CANNED_MAILBOX1) == 1
|
|
176
|
-
assert mesh_api_track_message_by_message_id_status(app, _CANNED_MAILBOX1, msg_1to2_id) == status.HTTP_200_OK
|
|
177
|
-
|
|
178
214
|
assert mesh_api_get_inbox_size(app, _CANNED_MAILBOX2) == 0
|
|
179
|
-
assert (
|
|
180
|
-
mesh_api_track_message_by_message_id_status(app, _CANNED_MAILBOX2, msg_2to1_id) == status.HTTP_404_NOT_FOUND
|
|
181
|
-
)
|
|
182
215
|
|
|
183
216
|
# clear_disk should default to true if file mode is used
|
|
184
217
|
if not clear_disk or clear_disk == "tRue":
|
mesh_sandbox/tests/helpers.py
CHANGED
|
@@ -69,7 +69,7 @@ def ensure_client_installed(java_path: str, base_dir: str, version: str): # pyl
|
|
|
69
69
|
version_dash = version.replace(".", "-")
|
|
70
70
|
|
|
71
71
|
installer_uri = (
|
|
72
|
-
"https://nhs
|
|
72
|
+
"https://digital.nhs.uk/binaries/content/assets/website-assets/services"
|
|
73
73
|
f"/message-exchange-for-social-care-and-health-mesh/mesh-installation-pack-client-{version_dash}.rar"
|
|
74
74
|
)
|
|
75
75
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
mesh_sandbox/__init__.py,sha256=
|
|
1
|
+
mesh_sandbox/__init__.py,sha256=0byemO6n6WCv41u9vBG2AIsOkVbxLvok7puvwy8EhfU,23
|
|
2
2
|
mesh_sandbox/api.py,sha256=F2KUKENAsSe6NAGG0wzHA2jebGF6mWFgta1q55oqacU,3925
|
|
3
3
|
mesh_sandbox/common/__init__.py,sha256=B0eGgN6SGCvNIsalhQOXhFJvxZaE4wJS_ratFOMMwvI,3071
|
|
4
4
|
mesh_sandbox/common/constants.py,sha256=_hnaHDkAQGHWLF7n_WfC5ZHIY5D-fUbOdpSqLusUMNY,6504
|
|
@@ -37,14 +37,14 @@ mesh_sandbox/store/data/mailboxes.jsonl,sha256=ADXpImNo9UH6rY6T9bqgI-BvnbziFaGwc
|
|
|
37
37
|
mesh_sandbox/store/data/messages.jsonl,sha256=ByqMoaoq_rZZgZFNhVkIVlL6OYnUpEBD4_jvvyEmIaI,2327
|
|
38
38
|
mesh_sandbox/store/data/workflows.jsonl,sha256=RFvycuqVmEkImeXlFD2wjuJFjt6dw581D_raPWstxpU,292
|
|
39
39
|
mesh_sandbox/store/file_store.py,sha256=ljWHpAJ0mab8gNRUXIHto6A5f0wUIaSh1BWk6wPxnJI,2223
|
|
40
|
-
mesh_sandbox/store/memory_store.py,sha256=
|
|
40
|
+
mesh_sandbox/store/memory_store.py,sha256=9co1coov8xhJhT68XC81MDMV1iRMFsOebwk2sqNo1lg,2807
|
|
41
41
|
mesh_sandbox/store/serialisation.py,sha256=pMYZ704GP74aCDRX9Nu1r4B1XA4BPJXYY-RKLFJJfUg,3615
|
|
42
42
|
mesh_sandbox/tests/__init__.py,sha256=wPjH0Ka1334a0OR9VMUfeYxsr03JqWjHTBnAH_1SB7I,106
|
|
43
|
-
mesh_sandbox/tests/admin.py,sha256=
|
|
43
|
+
mesh_sandbox/tests/admin.py,sha256=Y6qU2Cp528iZ2oiZ6ZmJzuuhpAe_Vnp37j0-oHewvNk,9634
|
|
44
44
|
mesh_sandbox/tests/docker_tests.py,sha256=nxErB5EDDvewgrgI-YqofsOqo52uYWCPTsk-ggK5axQ,1292
|
|
45
45
|
mesh_sandbox/tests/exceptions.py,sha256=j_jKskVzLAYpyu4qNAEY5ahkbk8Uh2Nc_CGpnpdXjnI,740
|
|
46
46
|
mesh_sandbox/tests/handshake.py,sha256=X-fCbwaEAc8cAvvnniCvt4W4DAV9ItPq7tpIpZkfj6M,6259
|
|
47
|
-
mesh_sandbox/tests/helpers.py,sha256=
|
|
47
|
+
mesh_sandbox/tests/helpers.py,sha256=wRC1t8mj4FKChebvwfcJWpxqK_nmE1NBUHgfCA2rBsk,6885
|
|
48
48
|
mesh_sandbox/tests/inbox.py,sha256=GLqOC6qlivKpp7qEtcGqv_nECkf2MhP4XwRWbIPC_ks,10412
|
|
49
49
|
mesh_sandbox/tests/java_client_tests.py,sha256=NYvNH1LxJc0SmHQ3q6mSvEd6Wuv2r_xMqAXW28sT2Pw,6547
|
|
50
50
|
mesh_sandbox/tests/lookup.py,sha256=wY8x0F415y2um48Lw5kyD4ugMo1vBGKB7cqPdHEaVO4,2768
|
|
@@ -58,7 +58,7 @@ mesh_sandbox/views/inbox.py,sha256=gnaD9Csx5BqilVRefQQ_tXmeq80lwcLJfepW005GrkU,5
|
|
|
58
58
|
mesh_sandbox/views/lookup.py,sha256=HHUqZ-Iy22ysC3qaO8Bl5GBQqf_7IiBbe5acyxqS78M,2775
|
|
59
59
|
mesh_sandbox/views/outbox.py,sha256=jxYiHylEdpljZ6Wl45Ke3aaH5rEKb-kzUuCNEKDS3So,4932
|
|
60
60
|
mesh_sandbox/views/tracking.py,sha256=FRjJgBI3WbTuuOw4Y6uWok0KIeOcjGl289eyyuTcwfo,8924
|
|
61
|
-
mesh_sandbox-0.1.
|
|
62
|
-
mesh_sandbox-0.1.
|
|
63
|
-
mesh_sandbox-0.1.
|
|
64
|
-
mesh_sandbox-0.1.
|
|
61
|
+
mesh_sandbox-0.1.23.dist-info/LICENSE,sha256=usgzIvDUpVX5pYZepJTRXQJqIaz0mdd32GuS5a3PFlY,1051
|
|
62
|
+
mesh_sandbox-0.1.23.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
|
|
63
|
+
mesh_sandbox-0.1.23.dist-info/METADATA,sha256=AKeVmQFBnGP6nPBDlYWZh13szVvTZ1zAI23La3UZAzg,2232
|
|
64
|
+
mesh_sandbox-0.1.23.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|