Skip to content

Commit

Permalink
Fix unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
fkantelberg committed Apr 23, 2024
1 parent c1c588d commit c41462f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/mail_devel/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ async def start(self) -> None:
r"/api/{account:\d+}/{mailbox:\d+}/{uid:\d+}/flags", self._api_flag
),
web.put(
r"/api/{account:\d+}/{mailbox:\d+}/{uid:\d+}/flags/{flag}",
r"/api/{account:\d+}/{mailbox:\d+}/{uid:\d+}/flags/{flag:[a-z]+}",
self._api_flag,
),
web.delete(
r"/api/{account:\d+}/{mailbox:\d+}/{uid:\d+}/flags/{flag}",
r"/api/{account:\d+}/{mailbox:\d+}/{uid:\d+}/flags/{flag:[a-z]+}",
self._api_flag,
),
]
Expand Down
8 changes: 4 additions & 4 deletions src/mail_devel/mailbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ async def append(

if not self.multi_user:
account = await self.get(self.config.demo_user)
mailbox = await account.get_mailbox(mailbox)
await mailbox.append(append_msg)
mailboxset = await account.get_mailbox(mailbox)
await mailboxset.append(append_msg)
return

for _, address in getaddresses(list(addresses)):
if address:
mailbox = await self.get(address)
mbox = await mailbox.get_mailbox(mailbox)
mailboxset = await self.get(address)
mbox = await mailboxset.get_mailbox(mailbox)
await mbox.append(append_msg)
6 changes: 3 additions & 3 deletions tests/test_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,13 @@ async def test_mail_devel_http_reply():
],
}
)
async with session.post("/api", json=msg) as response:
async with session.post("/api/1/1", json=msg) as response:
assert response.status == 200

async with session.post("/api", json={}) as response:
async with session.post("/api/1/1", json={}) as response:
assert response.status == 400

async with session.post("/api", json=[]) as response:
async with session.post("/api/1/1", json=[]) as response:
assert response.status == 400

async with session.get("/api/1/1") as response:
Expand Down

0 comments on commit c41462f

Please sign in to comment.