test: Unregister agents on keyboard interrupt
authorAki Niemi <aki.niemi@nokia.com>
Fri, 3 Dec 2010 12:47:40 +0000 (14:47 +0200)
committerAki Niemi <aki.niemi@nokia.com>
Fri, 3 Dec 2010 12:47:40 +0000 (14:47 +0200)
Control-C now calls UnregisterAgent(), so the agents exit cleanly.

test/test-push-notification
test/test-smart-messaging

index 4dca0d4..11d384c 100755 (executable)
@@ -44,4 +44,9 @@ if __name__ == '__main__':
        print "Agent registered"
 
        mainloop = gobject.MainLoop()
-       mainloop.run()
+
+       try:
+               mainloop.run()
+       except KeyboardInterrupt:
+               pn.UnregisterAgent(path)
+               mainloop.run()
index b263edd..0a37ba1 100755 (executable)
@@ -62,4 +62,9 @@ if __name__ == '__main__':
        print "Agent registered"
 
        mainloop = gobject.MainLoop()
-       mainloop.run()
+
+       try:
+               mainloop.run()
+       except KeyboardInterrupt:
+               pn.UnregisterAgent(path)
+               mainloop.run()