Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
moisses89 committed Dec 19, 2024
1 parent 2433738 commit a4b4315
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/tests/db/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class TestModel(DbAsyncConn):
async def test_contract(self, session: AsyncSession):
contract = Contract(address=b"a", name="A test contract", chain_id=1)
await contract.create(session)
await contract.create(session)
result = await contract.get_all(session)
self.assertEqual(result[0], contract)

Expand Down
12 changes: 9 additions & 3 deletions app/tests/routers/test_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@ def setUpClass(cls):

@database_session
async def test_view_contracts(self, session: AsyncSession):
contract = Contract(address=b"a", name="A Test Contracts", chain_id=1)
contract = Contract(
address=b"0xe94B2EC38FA88bDc8cA9110b24deB5341ECeF251",
name="A Test Contracts",
chain_id=1,
)
expected_response = {
"name": "A Test Contracts",
"description": None,
"address": "a",
"address": "0xe94B2EC38FA88bDc8cA9110b24deB5341ECeF251",
}
await contract.create(session)
response = self.client.get("/api/v1/contracts")
response = self.client.get(
"/api/v1/contracts/0xe94B2EC38FA88bDc8cA9110b24deB5341ECeF251"
)
self.assertEqual(response.status_code, 200)

0 comments on commit a4b4315

Please sign in to comment.