def test_build_service_with_proxy_config(self):
    default_proxy_config = {'httpProxy': 'http://proxy.mycorp.com:3128', 'httpsProxy': 'https://user:example@example.com:3129'}
    buildargs = {'HTTPS_PROXY': 'https://rdcf.th08.jp:8911', 'https_proxy': 'https://rdcf.th08.jp:8911'}
    self.mock_client._general_configs = {'proxies': {'default': default_proxy_config}}
    self.mock_client.base_url = 'http+docker://localunixsocket'
    self.mock_client.build.return_value = [b'{"stream": "Successfully built 12345"}']
    service = Service('foo', client=self.mock_client, build={'context': '.', 'args': buildargs})
    service.build()
    assert (self.mock_client.build.call_count == 1)
    assert (self.mock_client.build.call_args[1]['buildargs'] == {'HTTP_PROXY': default_proxy_config['httpProxy'], 'http_proxy': default_proxy_config['httpProxy'], 'HTTPS_PROXY': buildargs['HTTPS_PROXY'], 'https_proxy': buildargs['HTTPS_PROXY']})
def test_build_service_with_proxy_config(self):
    default_proxy_config = {'httpProxy': 'http://proxy.mycorp.com:3128', 'httpsProxy': 'https://user:example@example.com:3129'}
    buildargs = {'HTTPS_PROXY': 'https://rdcf.th08.jp:8911', 'https_proxy': 'https://rdcf.th08.jp:8911'}
    self.mock_client._general_configs = {'proxies': {'default': default_proxy_config}}
    self.mock_client.base_url = 'http+docker://localunixsocket'
    self.mock_client.build.return_value = [b'{"stream": "Successfully built 12345"}']
    service = Service('foo', client=self.mock_client, build={'context': '.', 'args': buildargs})
    service.build()
    assert (self.mock_client.build.call_count == 1)
    assert (self.mock_client.build.call_args[1]['buildargs'] == {'HTTP_PROXY': default_proxy_config['httpProxy'], 'http_proxy': default_proxy_config['httpProxy'], 'HTTPS_PROXY': buildargs['HTTPS_PROXY'], 'https_proxy': buildargs['HTTPS_PROXY']})