def test_config_dict_with_network_mode_from_container(self):
    self.mock_client.inspect_image.return_value = {'Id': 'abcd'}
    container = Container(self.mock_client, {'Id': 'aaabbb', 'Name': '/foo_1'})
    service = Service('foo', image='example.com/foo', client=self.mock_client, network_mode=ContainerNetworkMode(container))
    config_dict = service.config_dict()
    expected = {'image_id': 'abcd', 'options': {'image': 'example.com/foo'}, 'links': [], 'networks': {}, 'net': 'aaabbb', 'volumes_from': []}
    assert (config_dict == expected)
def test_config_dict_with_network_mode_from_container(self):
    self.mock_client.inspect_image.return_value = {'Id': 'abcd'}
    container = Container(self.mock_client, {'Id': 'aaabbb', 'Name': '/foo_1'})
    service = Service('foo', image='example.com/foo', client=self.mock_client, network_mode=ContainerNetworkMode(container))
    config_dict = service.config_dict()
    expected = {'image_id': 'abcd', 'options': {'image': 'example.com/foo'}, 'links': [], 'networks': {}, 'net': 'aaabbb', 'volumes_from': []}
    assert (config_dict == expected)