diff options
author | Barry Warsaw <barry@python.org> | 2011-12-15 19:37:23 -0500 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2011-12-15 19:37:23 -0500 |
commit | ef05d294e85978cf96a86535321cf914b605fa48 (patch) | |
tree | 0c9f5a67aed327134f8a1e76b08e7972846b1efc /test/test-standalone.py | |
parent | 8e87ac365f6b08c0617985488dd5d27148c9281d (diff) |
Fix the match rule semantics so that a match rule of "arg0='/'" does not match
object paths in Python3, as per Simon's review comments.
Diffstat (limited to 'test/test-standalone.py')
-rwxr-xr-x | test/test-standalone.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test-standalone.py b/test/test-standalone.py index 48cbe09..22e8444 100755 --- a/test/test-standalone.py +++ b/test/test-standalone.py @@ -344,6 +344,25 @@ class TestMessageMarshalling(unittest.TestCase): 'should fail') +class TestMatching(unittest.TestCase): + def setUp(self): + from _dbus_bindings import SignalMessage + from dbus.connection import SignalMatch + self._message = SignalMessage('/', 'a.b', 'c') + class FakeConn(object): pass + def ignore_cb(*args, **kws): pass + self._match = SignalMatch(FakeConn(), None, '/', None, None, + ignore_cb, arg0='/') + + def test_string_match(self): + self._message.append('/', signature='s') + self.assertTrue(self._match.maybe_handle_message(self._message)) + + def test_object_path_no_match(self): + self._message.append('/', signature='o') + self.assertFalse(self._match.maybe_handle_message(self._message)) + + if __name__ == '__main__': # Python 2.6 doesn't accept a `verbosity` keyword. kwargs = {} |