pytest
Assert raises exception
async def test_get_note_errors_when_note_not_found():
user_id = uuid4()
not_found_id = uuid4()
class FakeRepo:
async def findOne(self):
return None
service = NotesService({"user_id": user_id}, FakeRepo)
with pytest.raises(NotFoundException):
await service.get_note(not_found_id)