コード例 #1
0
ファイル: test_instance.py プロジェクト: zofuthan/paasta
def test_add_slave_info():
    mock_slave = mock.Mock(_MesosSlave__items={'some': 'thing'})
    mock_task = mock.Mock(_Task__items={'a': 'thing'},
                          slave=mock_slave)
    expected = {'a': 'thing',
                'slave': {'some': 'thing'}}
    assert instance.add_slave_info(mock_task)._Task__items == expected
コード例 #2
0
ファイル: test_instance.py プロジェクト: Yelp/paasta
def test_add_slave_info():
    mock_slave = asynctest.CoroutineMock(
        return_value=mock.Mock(_MesosSlave__items={"some": "thing"}),
        func=asynctest.CoroutineMock(),  # https://github.com/notion/a_sync/pull/40
    )
    mock_task = mock.Mock(_Task__items={"a": "thing"}, slave=mock_slave)
    expected = {"a": "thing", "slave": {"some": "thing"}}
    assert instance.add_slave_info(mock_task)._Task__items == expected
コード例 #3
0
def test_add_slave_info():
    mock_slave = asynctest.CoroutineMock(
        return_value=mock.Mock(_MesosSlave__items={'some': 'thing'}),
        func=asynctest.CoroutineMock(),  # https://github.com/notion/a_sync/pull/40
    )
    mock_task = mock.Mock(
        _Task__items={'a': 'thing'},
        slave=mock_slave,
    )
    expected = {
        'a': 'thing',
        'slave': {'some': 'thing'},
    }
    assert instance.add_slave_info(mock_task)._Task__items == expected