Merge lp:~kvalo/indicator-network/connman-mock-settings-support into lp:~indicator-applet-developers/indicator-network/indicator-network

Proposed by Kalle Valo on 2010-12-10
Status: Merged
Merged at revision: 120
Proposed branch: lp:~kvalo/indicator-network/connman-mock-settings-support
Merge into: lp:~indicator-applet-developers/indicator-network/indicator-network
Diff against target: 57 lines (+35/-8)
1 file modified
tests/connman-mock/connman-mock (+35/-8)
To merge this branch: bzr merge lp:~kvalo/indicator-network/connman-mock-settings-support
Reviewer Review Type Date Requested Status
Conor Curran (community) 2010-12-10 Approve on 2010-12-10
Review via email: mp+43344@code.launchpad.net
To post a comment you must log in.
Conor Curran (cjcurran) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/connman-mock/connman-mock'
2--- tests/connman-mock/connman-mock 2010-12-09 15:14:32 +0000
3+++ tests/connman-mock/connman-mock 2010-12-10 12:24:28 +0000
4@@ -84,18 +84,45 @@
5 self.properties["LoginRequired"] = False
6 self.properties["Favorite"] = False
7 self.properties["Immutable"] = False
8- self.properties["Autoconnect"] = False
9+ self.properties["AutoConnect"] = False
10
11- # FIXME: add Nameservers and Nameservers.Configuration
12- # FIXME: add Domains and Domains.Configuration
13- # FIXME: add IPv4 and IPv4.Configuration
14- # FIXME: add IPv6 and IPv4.Configuration
15- # FIXME: add Proxy
16- # FIXME: add Provider
17- # FIXME: add Ethernet
18+ self.properties["Nameservers"] = [ "127.0.0.1" ]
19+ self.properties["Nameservers.Configuration"] = [ "127.0.0.1" ]
20+ self.properties["Domains"] = [ "example.com" ]
21+ self.properties["Domains.Configuration"] = [ "example.com" ]
22+ self.properties["IPv4"] = {
23+ "Method" : "dhcp",
24+ "Address" : "192.168.1.2",
25+ "Netmask" : "255.255.255.0",
26+ "Gateway" : "192.168.1.1" }
27+ self.properties["IPv4.Configuration"] = { "Method" : "dhcp" }
28+ self.properties["IPv6"] = { "Method" : "off" }
29+ self.properties["IPv6.Configuration"] = { "Method" : "off" }
30+ self.properties["Proxy"] = { "Method" : "direct" }
31+ self.properties["Provider"] = dbus.Dictionary(signature='sv')
32+ self.properties["Ethernet"] = {
33+ "Interface" : "wlan0",
34+ "Method" : "auto",
35+ "Address" : "00:11:22:33:44:55" }
36
37 dbus.service.Object.__init__(self, bus_name, self.path)
38
39+ @dbus.service.method("net.connman.Service", in_signature="sv")
40+ def SetProperty(self, prop, value):
41+ rw = [ "Passphrase", "AutoConnect", "APN",
42+ "Nameservers.Configuration", "Domains.Configuration",
43+ "IPv4.Configuration", "IPv6.Configuration",
44+ "Proxy.Configuration" ]
45+
46+ if prop not in rw:
47+ raise dbus.DBusException("Can't change property: " + prop)
48+
49+ self.set_property(prop, value)
50+
51+ if prop == "Passphrase" and len(value) > 0 \
52+ and self.properties["PassphraseRequired"] == True:
53+ self.set_property("PassphraseRequired", False)
54+
55 @dbus.service.method("net.connman.Service", out_signature="a{sv}")
56 def GetProperties(self):
57 return self.properties

Subscribers

People subscribed via source and target branches