mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-08 17:08:30 +02:00
tests: Add test for up_client_async*() functions
This commit is contained in:
parent
c5282324d8
commit
8f893964a2
1 changed files with 15 additions and 0 deletions
|
|
@ -1967,6 +1967,21 @@ class Tests(dbusmock.DBusTestCase):
|
|||
self.assertEqual(client.get_critical_action(), 'HybridSleep')
|
||||
self.stop_daemon()
|
||||
|
||||
def test_lib_up_client_async(self):
|
||||
'''Test up_client_async_new()'''
|
||||
|
||||
self.start_daemon()
|
||||
|
||||
def client_new_cb(obj, task):
|
||||
nonlocal ml
|
||||
client = UPowerGlib.Client.new_finish(task)
|
||||
self.assertRegex(client.get_daemon_version(), '^[0-9.]+$')
|
||||
ml.quit()
|
||||
|
||||
ml = GLib.MainLoop()
|
||||
UPowerGlib.Client.new_async(None, client_new_cb)
|
||||
ml.run()
|
||||
|
||||
#
|
||||
# Helper methods
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue