예제 #1
0
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
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