summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2012-10-16Use a form of assertRaises() that works in Python 2.6Simon McVittie1-3/+2
2012-10-16Skip test_dbus_exception_convert_str_fail under unusual default encodingsSimon McVittie1-3/+8
This would actually work fine if the default encoding was UTF-8 or Latin-1 or something.
2012-10-16Support unicode messages for DBusException in Python 2Michael Vogt3-0/+95
[commit message amended -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55899 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-07-04run-test.sh: don't go via make to run the cross-testSimon McVittie1-2/+2
Based on a patch from Christoph Höger. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51725
2012-06-25fd.o #40817: validate UTF-8 according to the same rules as libdbusdbus-python-1.1.1Simon McVittie1-1/+58
2012-06-05Py3: correctly guess the signature of ObjectPath(...) and Signature(...)Simon McVittie1-0/+2
Under Python 2, ObjectPath and Signature are subtypes of str (= bytes), and the existing type-guessing worked. The type-guessing code assumed that all unicode objects were just strings, but that assumption became false in the Python 3 port: ObjectPath and Signature are still subtypes of str, but str now means unicode, not bytes. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=50740
2012-05-02Rename gobject_service (PyGI version) to gi_serviceSimon McVittie1-5/+5
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48904
2012-02-29Put sockets for the regression tests in /tmp, not ${builddir}Simon McVittie1-1/+1
Some automated build systems (naming no Portage) have really long build directories, which can cause dbus-python to hit the length limit for Unix sockets' names. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46747 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2012-01-11Test behaviour of various Message methodsSimon McVittie1-0/+54
2012-01-11Do not allow Byte(unicode(x)) (i.e. Byte(str(x)) in Python 3)Simon McVittie2-16/+40
Unicode strings aren't bytestrings, so there's no obvious meaning for the byte value of a Unicode string of length 1.
2011-12-17Quash a few more deprecations.Barry Warsaw2-6/+6
2011-12-16More Python 3 porting, this time primarily to get test-client.py working.Barry Warsaw3-124/+166
Changes include: - DBusException.get_dbus_message(): In Python 3, the str of the exception will already be a unicode, so don't try to decode it unless it's a bytes object (a.k.a. 8-bit str in Python 2). - gobject_service.py: Switch to pygi and rewrite the metaclass instantiation code to be portable between Python 2 and Python 3. - run-test.sh: echo a few more useful environment variables - test-client.py: - Globally replace deprecated assertEquals with assertEqual - Globally replace deprecated assert_ with assertTrue - Use bytes objects for both 'ay' signatured methods on the server - AcceptUnicodeString will return a native unicode, i.e. a str in Python 3 and a unicode in Python 2. Python 3 has no `unicode` built-in. - Reformat some long lines for debugging. - test-service.py: - Open the log file in 'a' mode for easier tailing. - AcceptUnicodeString will return a native unicode, i.e. a str in Python 3 and a unicode in Python 2. Python 3 has no `unicode` built-in. - reformat some long lines for debugging. - Put module-scope code into a main() function and add a bunch of logger output for better debugging. `session_bus` must still be global though. Wrap main() in a bit try/except to log all top-level exceptions.
2011-12-16Re-enable the other tests, even though these still fail for me (b.f.o #43303).Barry Warsaw2-9/+9
Fix another except syntax problem.
2011-12-15Re-enable previously disabled test.Barry Warsaw1-1/+2
2011-12-15Fix the match rule semantics so that a match rule of "arg0='/'" does not matchBarry Warsaw1-0/+19
object paths in Python3, as per Simon's review comments.
2011-12-15- Added back the missing PY3PORT.rst file, with updates.Barry Warsaw3-7/+13
- Disallow appending unicode objects with 'y' (bytes) signatures. This now requires either a bytes object or an integer. Update the tests to reflect - this change. - Fix broken __all__ in Python 3.
2011-12-15This is the big one; it adds Python 3 support.Barry Warsaw9-203/+335
2011-12-14First round of PyInt -> PyLong changes. These are only compatible with PythonBarry Warsaw1-3/+4
2, since there are still some unconditional PyInt calls, which are not valid in Python 3. However, it lays the framework for conditionalizing on Python 3 and using only PyLong in that case. Where it doesn't matter, PyLong is used unconditionally.
2011-12-13Use Python 3 syntax to catch exceptionsBarry Warsaw3-11/+11
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2010-12-02Add a regression test for fd.o #23831Simon McVittie2-1/+23
2010-12-02Use Py_CLEAR for greater robustnessSimon McVittie1-4/+4
2010-11-23fd.o #21831: deserialize empty ByteArray objects correctlySimon McVittie1-0/+7
For some reason libdbus gives us NULL instead of a pointer to a zero-length object (i.e. any random place in the message would do), which Py_BuildValue doesn't interpret the way we'd want it to.
2010-02-18tests/cross-test-*: don't use deprecated sets moduleSimon McVittie2-5/+3
set() has been a built-in since 2.4, and we don't support older versions.
2008-07-23Avoid some compiler warningsSimon McVittie1-0/+2
2008-07-17Omit the remote traceback from certain D-Bus errorsSimon McVittie2-0/+59
Specifically, DBusException and its subclasses no longer have the remote traceback by default (although subclasses can turn it back on again by setting include_traceback = True, and the various "programmer error" subclasses of DBusException do have this set). Hopefully this will stop people thinking it's a dbus-python or telepathy-python bug when a D-Bus API like Telepathy deliberately raises an error (and so dbus-python or telepathy-python is visible in the traceback).
2008-07-15Alter dbus.server.Server API to have pseudo-signalsSimon McVittie1-11/+13
By either appending to a list of callbacks, or subclassing and providing a method, you can be notified when connections are added or removed. Inspired by the DBusServer patch from Huang Peng.
2008-07-14test-server: import Connection from the right placeSimon McVittie1-2/+2
2008-07-14Initial support for DBusServer class (#14322).Mathias Hasselmann1-0/+74
2007-10-09Use MIT/X11 license as per permission given on the dbus mailing list.Simon McVittie2-0/+40
This affects code with copyright statements from the following individuals: * Anders Carlsson * Colin Walters * David Zeuthen * Rob Taylor and the following companies: * Collabora Ltd. (represented by me) * Red Hat Inc. (represented by Havoc Pennington)
2007-10-09test/: add some missing copyright headersSimon McVittie3-1/+31
2007-09-28Use MIT/X11 license for code owned by Collabora and Red Hat only, as per ↵Simon McVittie5-58/+93
Havoc's permission (Message-ID: <815098350709271800k2505485dlef9414609d392b48@mail.gmail.com>)
2007-09-27Update NEWS, and add regression tests for fd.o #12096 and #12403Simon McVittie2-0/+23
2007-09-27Relicense Collabora code under the MIT/X11 license proposed for dbus core, ↵Simon McVittie5-53/+91
removing all references to the LGPL as a result
2007-08-06Makefile.am, test/Makefile.am: Use @abs_top_builddir@, @abs_top_srcdir@Simon McVittie1-4/+6
This fixes incorrect Python path for docs and tests if doing an out-of-tree build using an absolute path for $(srcdir), and is also less ugly.
2007-08-01Add rel_path_keyword to @method (fd.o #11623)Simon McVittie2-11/+27
2007-08-01Avoid deprecated API in cross-testSimon McVittie2-9/+10
2007-08-01Fix introspection on objects with more than one connection or more than one ↵Simon McVittie2-0/+19
object path (bugs.fd.o #11794)
2007-07-31Measure async call timeout in seconds as intended, not in ms (blocking calls ↵Simon McVittie2-0/+53
already used seconds). Add regression tests
2007-07-26test-client: Avoid deprecated usage - explicitly pass SessionBus() to ↵Simon McVittie1-1/+1
BusName ctor
2007-06-18Implement fallback objects.Simon McVittie4-7/+85
In the process, simplify the signal decorator a bit - don't allow the signal to be emitted from a subset of interfaces (removing connection_keyword), deprecate path_keyword, disallow path_keyword on objects that support multiple object paths, and add rel_path_keyword. This is an API removal since previous patches, but is compatible with the last release.
2007-06-11dbus.service: Allow objects to start off unexported, and become exported later.Simon McVittie1-5/+3
Also allow them to be exported on more than one object path or even connection. dbus.decorators: Allow connection_keyword on signals and methods, so we can tell which connection to use for any follow-up actions.
2007-06-04dbus.service: change unexport() to remove_from_connection() at J5's requestSimon McVittie2-2/+2
2007-05-30dbus.service: Make it possible to unexport objects (fd.o#10457)Simon McVittie2-3/+51
2007-05-29_dbus_bindings/conn-methods.c: add list_exported_child_objects().Simon McVittie2-0/+11
This is equivalent to dbus_connection_list_registered() in libdbus.
2007-05-28dbus.connection: Release signals lock before calling _clean_up_signal_match().Simon McVittie2-10/+26
This prevents a deadlock when a signal match that's tracking name owner changes is removed, causing a match on NameOwnerChanged to be removed too. (Debian bug#426412) Also move more of the tree manipulation inside the lock, to be nice to anyone attempting a port to implementations without a GIL (mainly IronPython), and add a regression test for the above bug.
2007-05-09Don't run the examples during "make check" - timing/startup issues cause ↵Simon McVittie1-12/+12
intermittent failures
2007-05-03dbus/gobject_service.py: Make ExportedGObject work correctly.Simon McVittie2-0/+21
Also add a simple unit test for it.
2007-04-30test/test-p2p.py: Added. Test "peer-to-peer" connections.Simon McVittie3-0/+95
(Actually tested by connecting to the bus daemon, because I haven't implemented a Python binding for DBusServer yet.)
2007-04-30dbus/_bus_mixin.py: Add bindings for ListNames, ListActivatableNames, ↵Simon McVittie1-2/+22
GetNameOwner too
2007-04-27test/test-service.py: Use constants for the bus name and object pathSimon McVittie1-4/+5