fix async pytests

This commit is contained in:
Riccardo Balbo 2025-02-18 13:56:24 +00:00
commit f72bfca206
2 changed files with 4 additions and 6 deletions

View file

@ -21,6 +21,7 @@ jobs:
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install poetry pip install poetry
pip install pytest-asyncio
- name: Run setup script - name: Run setup script
run: | run: |

View file

@ -29,8 +29,7 @@ def nwc_service_provider2():
) )
@pytest.mark.asyncio def test_supported_methods(nwc_service_provider):
async def test_supported_methods(nwc_service_provider):
def make_invoice(provider, pubkey, content): def make_invoice(provider, pubkey, content):
return "invoice" return "invoice"
@ -39,8 +38,7 @@ async def test_supported_methods(nwc_service_provider):
assert s == ["make_invoice"] assert s == ["make_invoice"]
@pytest.mark.asyncio def test_encrytdecrypt(nwc_service_provider, nwc_service_provider2):
async def test_encrytdecrypt(nwc_service_provider, nwc_service_provider2):
content = "Hello World" content = "Hello World"
expected_enc = "qVurNVISSl/9CfREIhk5Lg==?iv=QpCo5dI9gUcoLsSMLA7o7Q==" expected_enc = "qVurNVISSl/9CfREIhk5Lg==?iv=QpCo5dI9gUcoLsSMLA7o7Q=="
enc_a = nwc_service_provider._encrypt_content( enc_a = nwc_service_provider._encrypt_content(
@ -63,8 +61,7 @@ async def test_encrytdecrypt(nwc_service_provider, nwc_service_provider2):
assert enc_b == expected_enc assert enc_b == expected_enc
@pytest.mark.asyncio def test_signverify(nwc_service_provider, nwc_service_provider2):
async def test_signverify(nwc_service_provider, nwc_service_provider2):
# Random content # Random content
content = "" content = ""
for _ in range(100): for _ in range(100):