def test_get_create_options_with_proxy_config(self):
    default_proxy_config = {'httpProxy': 'http://proxy.mycorp.com:3128', 'httpsProxy': 'https://user:example@example.com:3129', 'ftpProxy': 'http://ftpproxy.mycorp.com:21'}
    self.mock_client._general_configs = {'proxies': {'default': default_proxy_config}}
    self.mock_client.base_url = 'http+docker://localunixsocket'
    override_options = {'environment': {'FTP_PROXY': 'ftp://xdge.exo.au:21', 'ftp_proxy': 'ftp://xdge.exo.au:21'}}
    environment = {'HTTPS_PROXY': 'https://rdcf.th08.jp:8911', 'https_proxy': 'https://rdcf.th08.jp:8911'}
    service = Service('foo', client=self.mock_client, environment=environment)
    create_opts = service._get_container_create_options(override_options, 1)
    assert (set(create_opts['environment']) == set(format_environment({'HTTP_PROXY': default_proxy_config['httpProxy'], 'http_proxy': default_proxy_config['httpProxy'], 'HTTPS_PROXY': environment['HTTPS_PROXY'], 'https_proxy': environment['HTTPS_PROXY'], 'FTP_PROXY': override_options['environment']['FTP_PROXY'], 'ftp_proxy': override_options['environment']['FTP_PROXY']})))
def test_get_create_options_with_proxy_config(self):
    default_proxy_config = {'httpProxy': 'http://proxy.mycorp.com:3128', 'httpsProxy': 'https://user:example@example.com:3129', 'ftpProxy': 'http://ftpproxy.mycorp.com:21'}
    self.mock_client._general_configs = {'proxies': {'default': default_proxy_config}}
    self.mock_client.base_url = 'http+docker://localunixsocket'
    override_options = {'environment': {'FTP_PROXY': 'ftp://xdge.exo.au:21', 'ftp_proxy': 'ftp://xdge.exo.au:21'}}
    environment = {'HTTPS_PROXY': 'https://rdcf.th08.jp:8911', 'https_proxy': 'https://rdcf.th08.jp:8911'}
    service = Service('foo', client=self.mock_client, environment=environment)
    create_opts = service._get_container_create_options(override_options, 1)
    assert (set(create_opts['environment']) == set(format_environment({'HTTP_PROXY': default_proxy_config['httpProxy'], 'http_proxy': default_proxy_config['httpProxy'], 'HTTPS_PROXY': environment['HTTPS_PROXY'], 'https_proxy': environment['HTTPS_PROXY'], 'FTP_PROXY': override_options['environment']['FTP_PROXY'], 'ftp_proxy': override_options['environment']['FTP_PROXY']})))