diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2006-10-20 16:14:57 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2006-10-20 16:14:57 +0000 |
commit | 0c3340ae07127b34e6dd1d28ecbe1cae184a7b67 (patch) | |
tree | 018cb03508231d07c2f5864a09ddc35ed464e993 /test | |
parent | 5724b776de3ea55d81937dadefd912ac208c1576 (diff) |
Add some somewhat fragile test cases for the spec generation process
Diffstat (limited to 'test')
-rw-r--r-- | test/.git-darcs-dir | 0 | ||||
-rw-r--r-- | test/expected/.git-darcs-dir | 0 | ||||
-rw-r--r-- | test/expected/_Test.py | 47 | ||||
-rw-r--r-- | test/expected/errors.py | 37 | ||||
-rw-r--r-- | test/expected/interfaces.py | 16 | ||||
-rw-r--r-- | test/expected/introspect.canon | 1 | ||||
-rw-r--r-- | test/expected/spec.html.canon | 28 |
7 files changed, 129 insertions, 0 deletions
diff --git a/test/.git-darcs-dir b/test/.git-darcs-dir new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/.git-darcs-dir diff --git a/test/expected/.git-darcs-dir b/test/expected/.git-darcs-dir new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/expected/.git-darcs-dir diff --git a/test/expected/_Test.py b/test/expected/_Test.py new file mode 100644 index 00000000..997001f4 --- /dev/null +++ b/test/expected/_Test.py @@ -0,0 +1,47 @@ +# Generated from the Telepathy spec +"""\ + Copyright (C) 2006 Collabora Limited + + This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +""" + +import dbus.service +from telepathy._generated.interfaces import TEST_INTERFACE + +class _Test(dbus.service.Interface): + """\ + A test case for the spec processing. + """ + def __init__(self): + self._interfaces.add(TEST_INTERFACE) + + + @dbus.service.method(TEST_INTERFACE, in_signature='ba{sv}s', out_signature='asa(uv)') + def DoStuff(self, badger, mushroom, snake): + """ + Does stuff. + + """ + raise NotImplementedError + + @dbus.service.signal(TEST_INTERFACE, signature='aysb') + def StuffHappened(self, stoat, ferret, weasel): + """ + Emitted when stuff happened. + + """ + raise NotImplementedError +
\ No newline at end of file diff --git a/test/expected/errors.py b/test/expected/errors.py new file mode 100644 index 00000000..ea6b1245 --- /dev/null +++ b/test/expected/errors.py @@ -0,0 +1,37 @@ +# Generated from the Telepathy spec +"""\ + Copyright (C) 2006 Collabora Limited + + This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +""" + +from dbus import DBusException + + +class MiscError(DBusException): + """\ + Raised whenever appropriate. + + """ + _dbus_error_name = 'org.freedesktop.Telepathy.SpecAutoGenTest.MiscError' + +class OtherError(DBusException): + """\ + Raised at all other times. + + """ + _dbus_error_name = 'org.freedesktop.Telepathy.SpecAutoGenTest.OtherError' +
\ No newline at end of file diff --git a/test/expected/interfaces.py b/test/expected/interfaces.py new file mode 100644 index 00000000..a572cc11 --- /dev/null +++ b/test/expected/interfaces.py @@ -0,0 +1,16 @@ +# Generated from the Telepathy spec +"""\ +Copyright (C) 2006 Collabora Limited + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +""" +TEST_INTERFACE = 'org.freedesktop.Telepathy.SpecAutoGenTest' diff --git a/test/expected/introspect.canon b/test/expected/introspect.canon new file mode 100644 index 00000000..214178c4 --- /dev/null +++ b/test/expected/introspect.canon @@ -0,0 +1 @@ +<node xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" name="/_Test"><interface name="org.freedesktop.Telepathy.SpecAutoGenTest"><method name="DoStuff"><arg direction="in" name="badger" type="b"></arg><arg direction="in" name="mushroom" type="a{sv}"></arg><arg direction="in" name="snake" type="s"></arg><arg direction="out" type="asa(uv)"></arg></method><signal name="StuffHappened"><arg direction="in" name="stoat" type="ay"></arg><arg direction="in" name="ferret" type="s"></arg><arg direction="in" name="weasel" type="b"></arg></signal></interface></node>
\ No newline at end of file diff --git a/test/expected/spec.html.canon b/test/expected/spec.html.canon new file mode 100644 index 00000000..cca83c61 --- /dev/null +++ b/test/expected/spec.html.canon @@ -0,0 +1,28 @@ +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta content="text/html; charset=ascii" http-equiv="Content-Type"></meta><title>Telepathy D-Bus Interface Specification</title><style type="text/css" xml:space="preserve"></style></head><body><div class="topbox">Telepathy</div><h3>Version 0.1.2</h3><pre xml:space="preserve"> +Copyright (C) 2006 Collabora Limited + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. +</pre><h1><a id="org.freedesktop.Telepathy.SpecAutoGenTest" name="org.freedesktop.Telepathy.SpecAutoGenTest" shape="rect"></a>org.freedesktop.Telepathy.SpecAutoGenTest</h1><pre xml:space="preserve"> + A test case for the spec processing. + </pre><h2>Methods:</h2><div class="method"><h3>DoStuff ( + b: badger, a{sv}: mushroom, s: snake + ) -> + asa(uv)</h3><pre xml:space="preserve"> + Does stuff. + </pre></div><h2>Signals:</h2><div class="signal"><h3>StuffHappened ( + ay: stoat, s: ferret, b: weasel + )</h3><pre xml:space="preserve"> + Emitted when stuff happened. + </pre></div><h1 xmlns="">Errors</h1><h2><a id="org.freedesktop.Telepathy.SpecAutoGenTest.MiscError" name="org.freedesktop.Telepathy.SpecAutoGenTest.MiscError" shape="rect"></a>org.freedesktop.Telepathy.SpecAutoGenTest.MiscError</h2><pre xml:space="preserve"> + Raised whenever appropriate. + </pre><h2><a id="org.freedesktop.Telepathy.SpecAutoGenTest.OtherError" name="org.freedesktop.Telepathy.SpecAutoGenTest.OtherError" shape="rect"></a>org.freedesktop.Telepathy.SpecAutoGenTest.OtherError</h2><pre xml:space="preserve"> + Raised at all other times. + </pre></body></html>
\ No newline at end of file |