Merge lp:~alecu/ubuntuone-client/proxy-tunnel-process into lp:ubuntuone-client
Proposed by
Alejandro J. Cura
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | dobey | ||||
Approved revision: | 1219 | ||||
Merged at revision: | 1204 | ||||
Proposed branch: | lp:~alecu/ubuntuone-client/proxy-tunnel-process | ||||
Merge into: | lp:ubuntuone-client | ||||
Prerequisite: | lp:~alecu/ubuntuone-client/proxy-tunnel-client | ||||
Diff against target: |
266 lines (+188/-1) 4 files modified
Makefile.am (+1/-0) bin/ubuntuone-proxy-tunnel (+24/-0) tests/proxy/test_tunnel_server.py (+132/-1) ubuntuone/proxy/tunnel_server.py (+31/-0) |
||||
To merge this branch: | bzr merge lp:~alecu/ubuntuone-client/proxy-tunnel-process | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alejandro J. Cura (community) | Abstain | ||
Eric Casteleijn (community) | Approve | ||
Manuel de la Peña (community) | Approve | ||
Review via email: mp+96212@code.launchpad.net |
Commit message
- A proxy tunnel process to be started when proxies are enabled (LP: #929207).
Description of the change
- A proxy tunnel process to be started when proxies are enabled. (LP: #929207)
To post a comment you must log in.
A very stupid comments but why doing:
if len(proxies) and proxies[0].type() != QNetworkProxy. NoProxy:
return True
When you an do:
return len(proxies) and proxies[0].type() != QNetworkProxy. NoProxy
same for:
if settings:
return True
In IsProxyEnabledT estCase I think you can merge the tests cases, for example:
def _assert_ enabled( self, platform):
"""Assert that the proxy is enabled."""
self. patch(tunnel_ server. sys, "platform", platform)
ret = tunnel_ server. is_proxy_ enabled( SAMPLE_ HOST, str(SAMPLE_PORT))
self. assertTrue( ret, "Proxy is enabled.")
def test_platform_ linux_enabled( self):
"""Tests for the linux platform with proxies enabled."""
self. patch(tunnel_ server. gsettings, "get_proxy_ settings" ,
lambda: FAKE_SETTINGS)
self. _assert_ enabled( 'linux3' )
def test_platform_ other_enabled( self):
"""Tests for any other platform with proxies enabled."""
fake_ netproxfact = FakeNetworkProx yFactoryClass( True)
self. patch(tunnel_ server, "QNetworkProxyF actory" , fake_netproxfact)
self. _assert_ enabled( 'windows 1.0')
Same for the disabled one.
I think it would be a good idea to use sys.exit in main specially in the case were there is no proxy.