Python backend for a Slack's kudos plugin.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: tests working and more coverage

+7 -5
+1 -1
.coveragerc
··· 1 1 [run] 2 2 include = kefi/* 3 - omit = *migrations*, *config* 3 + omit = *migrations*, *config*, manage.py
+2 -3
kefi/tests/test_commands.py
··· 1 1 from fastapi.testclient import TestClient 2 - from pytest_mock import MockFixture 3 2 from pytest_mock.plugin import MockerFixture 4 3 from slack_sdk.web.client import WebClient 5 4 from sqlmodel import Session ··· 11 10 from kefi.tests.helpers import generate_command 12 11 13 12 14 - def test_unknown_commad(mocker: MockFixture, session: Session, client: TestClient): 13 + def test_unknown_commad(session: Session, client: TestClient): 15 14 """Test command /kefi unknown""" 16 15 17 16 response = client.post("/command/", data=generate_command(text="unknown")) ··· 20 19 assert len(users) == 1 21 20 22 21 23 - def test_empty_commad(session: Session, client: TestClient): 22 + def test_empty_commad(client: TestClient): 24 23 """Test command /kefi""" 25 24 26 25 response = client.post("/command/", data=generate_command(text=""))
+4 -1
kefi/tests/test_responses.py
··· 1 + from typing import Optional 2 + 1 3 from sqlmodel import Session, select 2 4 3 5 from kefi.constants import Command ··· 12 14 user_2 = User(slack_user_id="U2", slack_username="user2") 13 15 session.add(user_1) 14 16 session.add(user_2) 15 - action = session.exec( 17 + action: Optional[Action] = session.exec( 16 18 select(Action).filter(Action.keyword == Command.KUDOS) 17 19 ).one_or_none() 20 + assert action is not None 18 21 action_response = ActionResponse( 19 22 sender=user_1, receiver=user_2, action=action, message="Test", channel_id="C1" 20 23 )