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
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
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