~ubuntu-branches/ubuntu/maverick/ubuntu-system-service/maverick

« back to all changes in this revision

Viewing changes to test/test_keyboard

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2009-07-15 13:34:15 UTC
  • Revision ID: james.westby@ubuntu.com-20090715133415-svvfjoyunhn0siej
Tags: 0.1.15
* ported to policykit-1
* install backend/com.ubuntu.systemservice.policy.in to the
  new polkit-1 action location
* updated tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
print ser.get_keyboard()
15
15
 
16
 
try:
17
 
   ser.set_keyboard("", "us", "", "")
18
 
except dbus.DBusException, e:
19
 
   print e
20
 
   obj = session_bus.get_object('org.freedesktop.PolicyKit.AuthenticationAgent', '/', False)
21
 
   auth = dbus.Interface(obj, "org.freedesktop.PolicyKit.AuthenticationAgent")
22
 
   res = auth.ObtainAuthorization(priv,
23
 
                                  dbus.UInt32(0),
24
 
                                  dbus.UInt32(os.getpid()), 
25
 
                                  timeout=300)
26
 
   if res:
27
 
      print "settings keyboard"
28
 
      res = ser.set_keyboard("pc105", "de","nodeadkeys", "ctrl:nocaps")
29
 
      assert (res == True)
30
 
   else:
31
 
      print "authentication failure"
 
16
res = ser.set_keyboard("", "us", "", "")
 
17
if res:
 
18
   print "settings keyboard"
 
19
   res = ser.set_keyboard("pc105", "de","nodeadkeys", "ctrl:nocaps")
 
20
   assert (res == True)
32
21
 
33
22
# illeal char in variant
34
23
assert(ser.set_keyboard("pc105", "de", "?", "ctrl:nocaps") == False)