From 83b5fdc85d50f68722bd1b2cad69e4519ab9b25f Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 26 Feb 2013 19:34:14 -0500 Subject: Use a special desktop file for testing --- test/Makefile.am | 3 ++- test/applications/test.desktop | 2 ++ test/test-client.py | 12 ++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 test/applications/test.desktop (limited to 'test') diff --git a/test/Makefile.am b/test/Makefile.am index 87ae2c3..4f1a163 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -72,6 +72,7 @@ libindicator_messages_service_la_LDFLAGS = \ TESTS_ENVIRONMENT = \ export LD_LIBRARY_PATH=$(top_builddir)/libmessaging-menu/.libs; \ - export GI_TYPELIB_PATH=$(top_builddir)/libmessaging-menu; + export GI_TYPELIB_PATH=$(top_builddir)/libmessaging-menu; \ + export XDG_DATA_DIRS=$(abs_srcdir); TESTS += test-client.py diff --git a/test/applications/test.desktop b/test/applications/test.desktop new file mode 100644 index 0000000..c2332b9 --- /dev/null +++ b/test/applications/test.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Type=Application diff --git a/test/test-client.py b/test/test-client.py index e012d6e..af5d119 100755 --- a/test/test-client.py +++ b/test/test-client.py @@ -44,25 +44,25 @@ class MessagingMenuTest(dbusmock.DBusTestCase): self.assertEqual(args[i], expected_args[i]) def test_registration(self): - mmapp = MessagingMenu.App.new('empathy.desktop') + mmapp = MessagingMenu.App.new('test.desktop') mmapp.register() self.spin_loop() - self.assertMethodCalled('RegisterApplication', 'empathy.desktop', None) + self.assertMethodCalled('RegisterApplication', 'test.desktop', None) mmapp.unregister() self.spin_loop() - self.assertMethodCalled('UnregisterApplication', 'empathy.desktop') + self.assertMethodCalled('UnregisterApplication', 'test.desktop') # ApplicationStoppedRunning is called when the last ref on mmapp is dropped del mmapp self.spin_loop() - self.assertMethodCalled('ApplicationStoppedRunning', 'empathy.desktop') + self.assertMethodCalled('ApplicationStoppedRunning', 'test.desktop') def test_status(self): - mmapp = MessagingMenu.App.new('empathy.desktop') + mmapp = MessagingMenu.App.new('test.desktop') mmapp.register() mmapp.set_status(MessagingMenu.Status.AWAY) self.spin_loop() - self.assertMethodCalled('SetStatus', 'empathy.desktop', 'away') + self.assertMethodCalled('SetStatus', 'test.desktop', 'away') unittest.main(testRunner=unittest.TextTestRunner()) -- cgit v1.2.3