Skip to content

Commit

Permalink
Fix: Solved last test issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres D. Molins committed Oct 24, 2024
1 parent 700f957 commit 2bb2d3d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 deletions tests/api/test_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ async def test_get_balance(
response = await ccn_api_client.get(MESSAGES_URI)
assert response.status == 200, await response.text()
data = await response.json()
assert data["balance"] == user_balance.balance
assert data["locked_amount"] == 2002.4666666666667
assert data["balance"] == str(user_balance.balance)
assert data["locked_amount"] == 2002.46666666666669698315672576427459716796875
8 changes: 2 additions & 6 deletions tests/api/test_list_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ async def test_get_messages(fixture_messages: Sequence[Dict[str, Any]], ccn_api_
@pytest.mark.asyncio
async def test_get_messages_filter_by_channel(fixture_messages, ccn_api_client):
async def fetch_messages_by_channel(channel: str) -> Dict:
response = await ccn_api_client.get(
MESSAGES_URI, params={"channels": channel}
)
response = await ccn_api_client.get(MESSAGES_URI, params={"channels": channel})
assert response.status == 200, await response.text()
return await response.json()

Expand Down Expand Up @@ -194,9 +192,7 @@ async def test_get_messages_filter_by_tags(
assert len(messages) == 2

# Matching tags for both messages
response = await ccn_api_client.get(
MESSAGES_URI, params={"tags": "original,amend"}
)
response = await ccn_api_client.get(MESSAGES_URI, params={"tags": "original,amend"})
assert response.status == 200, await response.text()
messages = (await response.json())["messages"]
assert len(messages) == 2
Expand Down
4 changes: 1 addition & 3 deletions tests/api/test_posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,7 @@ async def test_get_amended_posts_tags(
session.commit()

# Match one tag
response = await ccn_api_client.get(
"/api/v0/posts.json", params={"tags": "amend"}
)
response = await ccn_api_client.get("/api/v0/posts.json", params={"tags": "amend"})
assert response.status == 200
response_json = await response.json()
assert len(response_json["posts"]) == 1
Expand Down
4 changes: 2 additions & 2 deletions tests/chains/test_chain_data_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async def test_smart_contract_protocol_ipfs_store(
publisher="KT1BfL57oZfptdtMFZ9LNakEPvuPPA2urdSW",
protocol=ChainSyncProtocol.SMART_CONTRACT,
protocol_version=1,
content=payload.model_dump(),
content=payload.dict(),
)

chain_data_service = ChainDataService(
Expand Down Expand Up @@ -146,7 +146,7 @@ async def test_smart_contract_protocol_regular_message(
publisher="KT1BfL57oZfptdtMFZ9LNakEPvuPPA2urdSW",
protocol=ChainSyncProtocol.SMART_CONTRACT,
protocol_version=1,
content=payload.model_dump(),
content=payload.dict(),
)

chain_data_service = ChainDataService(
Expand Down

0 comments on commit 2bb2d3d

Please sign in to comment.