Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: 'called_once' is not a valid assertion. #123

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions tests/unit/test_asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def test_create_post(mock_session_with_post_success):
sync=False,
)

assert mock_session_with_post_success.http_session.post.called_once
assert mock_session_with_post_success.http_session.post.assert_called_once
assert isinstance(post_message, PostMessage)
assert message_status == MessageStatus.PENDING

Expand All @@ -47,7 +47,7 @@ async def test_create_aggregate(mock_session_with_post_success):
channel="TEST",
)

assert mock_session_with_post_success.http_session.post.called_once
assert mock_session_with_post_success.http_session.post.assert_called_once
assert isinstance(aggregate_message, AggregateMessage)


Expand Down Expand Up @@ -83,7 +83,7 @@ async def test_create_store(mock_session_with_post_success):
storage_engine=StorageEnum.storage,
)

assert mock_session_with_post_success.http_session.post.called
assert mock_session_with_post_success.http_session.post.assert_called
assert isinstance(store_message, StoreMessage)


Expand All @@ -98,7 +98,7 @@ async def test_create_program(mock_session_with_post_success):
metadata={"tags": ["test"]},
)

assert mock_session_with_post_success.http_session.post.called_once
assert mock_session_with_post_success.http_session.post.assert_called_once
assert isinstance(program_message, ProgramMessage)


Expand All @@ -118,7 +118,7 @@ async def test_create_instance(mock_session_with_post_success):
hypervisor=HypervisorType.qemu,
)

assert mock_session_with_post_success.http_session.post.called_once
assert mock_session_with_post_success.http_session.post.assert_called_once
assert isinstance(instance_message, InstanceMessage)


Expand All @@ -139,7 +139,7 @@ async def test_create_instance_no_payment(mock_session_with_post_success):
assert instance_message.content.payment.type == PaymentType.hold
assert instance_message.content.payment.chain == Chain.ETH

assert mock_session_with_post_success.http_session.post.called_once
assert mock_session_with_post_success.http_session.post.assert_called_once
assert isinstance(instance_message, InstanceMessage)


Expand All @@ -159,7 +159,7 @@ async def test_create_instance_no_hypervisor(mock_session_with_post_success):

assert instance_message.content.environment.hypervisor == HypervisorType.firecracker

assert mock_session_with_post_success.http_session.post.called_once
assert mock_session_with_post_success.http_session.post.assert_called_once
assert isinstance(instance_message, InstanceMessage)


Expand All @@ -172,7 +172,7 @@ async def test_forget(mock_session_with_post_success):
channel="TEST",
)

assert mock_session_with_post_success.http_session.post.called_once
assert mock_session_with_post_success.http_session.post.assert_called_once
assert isinstance(forget_message, ForgetMessage)


Expand Down
Loading