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()