Skip to content

Commit ac4abf8

Browse files
committed
Enable skipped tests
1 parent 9bf6440 commit ac4abf8

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

aidbox_python_sdk/sdk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ def get_subscription_handler(self, path):
136136

137137
def was_subscription_triggered_n_times(self, entity, counter):
138138
timeout = 10
139-
future = asyncio.Future()
140139
target_loop = asyncio.get_running_loop()
140+
future = target_loop.create_future()
141141
self._sub_triggered[entity] = (target_loop, future, counter)
142142
target_loop.call_later(
143143
timeout,

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ services:
3030
context: .
3131
args:
3232
PYTHON_VERSION: ${PYTHON:-3.11}
33-
command: ["pipenv", "run", "pytest"]
33+
command: ["pipenv", "run", "pytest", "--cov", "aidbox_python_sdk"]
3434
depends_on:
3535
aidbox:
3636
condition: service_healthy

tests/test_sdk.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,33 +52,30 @@ async def test_live_health_check(client):
5252
assert json == {"status": "OK"}
5353

5454

55-
@pytest.mark.skip
56-
async def test_signup_reg_op(aidbox):
57-
resp = await aidbox.post("signup/register/21.02.19/testvalue")
58-
assert resp.status == 200
59-
json = await resp.json()
55+
@pytest.mark.asyncio
56+
async def test_signup_reg_op(aidbox_client):
57+
json = await aidbox_client.execute("signup/register/21.02.19/testvalue")
6058
assert json == {
6159
"success": "Ok",
6260
"request": {"date": "21.02.19", "test": "testvalue"},
6361
}
6462

6563

66-
@pytest.mark.skip
67-
async def test_appointment_sub(sdk, aidbox):
64+
@pytest.mark.asyncio
65+
async def test_appointment_sub(sdk, aidbox_client, safe_db):
6866
with mock.patch.object(main, "_appointment_sub") as appointment_sub:
6967
f = asyncio.Future()
7068
f.set_result("")
7169
appointment_sub.return_value = f
7270
was_appointment_sub_triggered = sdk.was_subscription_triggered("Appointment")
73-
resp = await aidbox.post(
71+
resource = aidbox_client.resource(
7472
"Appointment",
75-
json={
73+
**{
7674
"status": "proposed",
7775
"participant": [{"status": "accepted"}],
78-
"resourceType": "Appointment",
7976
},
8077
)
81-
assert resp.status == 201
78+
await resource.save()
8279
await was_appointment_sub_triggered
8380
event = appointment_sub.call_args_list[0][0][0]
8481
logging.debug("event: %s", event)

0 commit comments

Comments
 (0)