Skip to content

Commit 6487f11

Browse files
committed
fix: couple of fixes
1 parent e781250 commit 6487f11

2 files changed

Lines changed: 11 additions & 15 deletions

File tree

examples/api_keys_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ async def main() -> None:
3232

3333

3434
if __name__ == "__main__":
35-
asyncio.run(main())
35+
asyncio.run(main())

tests/api_keys_async_test.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import pytest
21
import resend
32
from resend.exceptions import NoContentError
43
from tests.conftest import ResendBaseTest
@@ -7,7 +6,6 @@
76

87

98
class TestResendApiKeysAsync(ResendBaseTest):
10-
@pytest.mark.asyncio
119
async def test_api_keys_create_async(self) -> None:
1210
self.set_mock_json(
1311
{
@@ -22,16 +20,16 @@ async def test_api_keys_create_async(self) -> None:
2220
key: resend.ApiKey = await resend.ApiKeys.create_async(params)
2321
assert key["id"] == "dacf4072-4119-4d88-932f-6202748ac7c8"
2422

25-
@pytest.mark.asyncio
26-
async def test_should_create_api_key_async_raise_exception_when_no_content(self) -> None:
23+
async def test_should_create_api_key_async_raise_exception_when_no_content(
24+
self,
25+
) -> None:
2726
self.set_mock_json(None)
2827
params: resend.ApiKeys.CreateParams = {
2928
"name": "prod",
3029
}
3130
with self.assertRaises(NoContentError):
3231
_ = await resend.ApiKeys.create_async(params)
3332

34-
@pytest.mark.asyncio
3533
async def test_api_keys_list_async(self) -> None:
3634
self.set_mock_json(
3735
{
@@ -51,19 +49,17 @@ async def test_api_keys_list_async(self) -> None:
5149
assert key["name"] == "Production"
5250
assert key["created_at"] == "2023-04-08T00:11:13.110779+00:00"
5351

54-
@pytest.mark.asyncio
55-
async def test_should_list_api_key_async_raise_exception_when_no_content(self) -> None:
52+
async def test_should_list_api_key_async_raise_exception_when_no_content(
53+
self,
54+
) -> None:
5655
self.set_mock_json(None)
5756
with self.assertRaises(NoContentError):
5857
_ = await resend.ApiKeys.list_async()
5958

60-
@pytest.mark.asyncio
6159
async def test_api_keys_remove_async(self) -> None:
6260
self.set_mock_text("")
6361

64-
assert (
65-
await resend.ApiKeys.remove_async(
66-
api_key_id="4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
67-
)
68-
is None
69-
)
62+
# Remove operation returns None, verify no exceptions raised
63+
await resend.ApiKeys.remove_async(
64+
api_key_id="4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
65+
)

0 commit comments

Comments
 (0)