Ejemplo n.º 1
0
async def test_should_create_new_poll_when_no_prev_poll_exists() -> None:
    # Arrange
    pollmanager_mock = MagicMock()
    pollmanager_mock.create = CoroutineMock()
    command = mensa.Etm(pollmanager=pollmanager_mock, master=MagicMock())

    # Act
    await command.handle('etm', '', MagicMock())

    # Assert
    pollmanager_mock.create.assert_called_once()
Ejemplo n.º 2
0
def get_pollmanger(poll: MagicMock) -> MagicMock:
    pollmanager_mock = MagicMock()
    pollmanager_mock.create = CoroutineMock()
    pollmanager_mock.polls.get.return_value = poll
    return pollmanager_mock