~ubuntu-branches/ubuntu/quantal/ubuntu-system-service/quantal-updates

« back to all changes in this revision

Viewing changes to test/interactive/test_reset_proxy

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt, Gabor Kelemen, Michael Vogt
  • Date: 2011-10-21 19:00:54 UTC
  • Revision ID: james.westby@ubuntu.com-20111021190054-i57pyvs6sv9h1rpd
Tags: 0.2
[ Gabor Kelemen ]
* Let p-d-u handle i18n of the .policy file. LP: #853354

[ Michael Vogt ]
* fixes for the new python-apt API
* improve code layout, move backend into UbuntuSystemService.backend
* improve tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
import dbus
 
4
import os
 
5
 
 
6
priv = "com.ubuntu.systemservice.setproxy"
 
7
 
 
8
session_bus = dbus.SessionBus()
 
9
system_bus = dbus.SystemBus()
 
10
 
 
11
ser = dbus.Interface(system_bus.get_object("com.ubuntu.SystemService","/"),
 
12
                     "com.ubuntu.SystemService")
 
13
 
 
14
print ser.get_proxy("http")
 
15
 
 
16
res = ser.set_proxy("http", "http://test:3128/")
 
17
print res
 
18
 
 
19
ser.set_proxy("http","")
 
20
ser.set_proxy("ftp","")
 
21
 
 
22
print "new http proxy: '%s'" % ser.get_proxy("http")
 
23
print "new ftp proxy: '%s'" % ser.get_proxy("ftp")
 
24
 
 
25
#print ser.get_proxy("http-invalid-proto")