This commit is contained in:
Phill Ridout 2018-06-08 07:12:23 +01:00
parent dce509e909
commit fac5d4b798
3 changed files with 5 additions and 4 deletions

View File

@ -91,9 +91,9 @@ def get_proxy_settings(mode=None):
basic_auth = '{username}:{password}@'.format(username=username, password=password)
http_value = None
https_value = None
if http_addr is not None:
if http_addr:
http_value = 'http://{basic_auth}{http_addr}'.format(basic_auth=basic_auth, http_addr=http_addr)
if https_addr is not None:
if https_addr:
https_value = 'https://{basic_auth}{https_addr}'.format(basic_auth=basic_auth, https_addr=https_addr)
return {'http': http_value, 'https': https_value}

View File

@ -199,6 +199,7 @@ def get_repo_name():
"""
This returns the name of branch of the working directory. For example it returns *lp:~googol/openlp/render*.
"""
return 'lp:~phill-ridout/openlp/proxies'
# Run the bzr command.
bzr = Popen(('bzr', 'info'), stdout=PIPE, stderr=PIPE)
raw_output, error = bzr.communicate()

View File

@ -349,8 +349,8 @@ class TestGetProxySettings(TestCase, TestMixin):
"""
# GIVEN: A `proxy mode` setting of MANUAL_PROXY with no servers specified
Settings().setValue('advanced/proxy mode', ProxyMode.MANUAL_PROXY)
Settings().setValue('advanced/proxy http', None)
Settings().setValue('advanced/proxy https', None)
Settings().setValue('advanced/proxy http', '')
Settings().setValue('advanced/proxy https', '')
Settings().setValue('advanced/proxy username', 'user')
Settings().setValue('advanced/proxy password', 'pass')