From 4da88364951bc03a076ee93e1db23648c10e0b34 Mon Sep 17 00:00:00 2001 From: Aki Niemi Date: Fri, 3 Dec 2010 14:47:40 +0200 Subject: [PATCH] test: Unregister agents on keyboard interrupt Control-C now calls UnregisterAgent(), so the agents exit cleanly. --- test/test-push-notification | 7 ++++++- test/test-smart-messaging | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/test/test-push-notification b/test/test-push-notification index 4dca0d46..11d384cd 100755 --- a/test/test-push-notification +++ b/test/test-push-notification @@ -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() diff --git a/test/test-smart-messaging b/test/test-smart-messaging index b263eddb..0a37ba14 100755 --- a/test/test-smart-messaging +++ b/test/test-smart-messaging @@ -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()