aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-02-26 19:34:14 -0500
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-02-26 19:34:14 -0500
commit83b5fdc85d50f68722bd1b2cad69e4519ab9b25f (patch)
treea82ee1705ddf4c5b0d1660f71878a4519104721f /test
parentd98feb7174b8b66059bce11abe5d2c0fb5c418cb (diff)
downloadayatana-indicator-messages-83b5fdc85d50f68722bd1b2cad69e4519ab9b25f.tar.gz
ayatana-indicator-messages-83b5fdc85d50f68722bd1b2cad69e4519ab9b25f.tar.bz2
ayatana-indicator-messages-83b5fdc85d50f68722bd1b2cad69e4519ab9b25f.zip
Use a special desktop file for testing
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am3
-rw-r--r--test/applications/test.desktop2
-rwxr-xr-xtest/test-client.py12
3 files changed, 10 insertions, 7 deletions
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())