Esempio n. 1
0
def test_get_task(mock_session):
    fake_task = models.Task()
    mock_session.return_value.__enter__.return_value. \
        query.return_value.filter.return_value.first.return_value = \
        fake_task
    result = api.get_task(None, 'a9e54256-2b8b-47d9-8ca1-355db52d60f1')
    assert result == fake_task
Esempio n. 2
0
def test_get_task_with_None(mock_session):
    mock_session.return_value.__enter__.return_value. \
        query.return_value.filter.return_value = []
    result = api.get_task(None, 'a9e54256-2b8b-47d9-8ca1-355db52d60f1')
    assert result is None