Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/enginetests.py30
-rw-r--r--tests/translatortests.py6
2 files changed, 34 insertions, 2 deletions
diff --git a/tests/enginetests.py b/tests/enginetests.py
new file mode 100644
index 0000000..60a68f4
--- /dev/null
+++ b/tests/enginetests.py
@@ -0,0 +1,30 @@
+# Copyright (C) 2009, Tutorius.org
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+import unittest
+
+import dbus
+
+session_bus = dbus.SessionBus()
+
+ENGINE_BUS_NAME = "org.tutorius.engine"
+
+LAUNCH_PATH = "/launch"
+STOP_PATH = "/stop"
+PAUSE_PATH = "/pause"
+
+class EngineInterfaceTests(unittest.TestCase):
+ pass
diff --git a/tests/translatortests.py b/tests/translatortests.py
index e71b795..3b5ca6f 100644
--- a/tests/translatortests.py
+++ b/tests/translatortests.py
@@ -21,6 +21,7 @@ import uuid
from sugar.tutorius.translator import *
from sugar.tutorius.properties import *
from sugar.tutorius.tutorial import *
+from sugar.tutorius.vault import Vault
from sugar.tutorius import addon
##############################################################################
@@ -97,8 +98,6 @@ class ResourceTranslatorTests(unittest.TestCase):
self.translator = ResourceTranslator(self.prob_man, self.tutorial_id)
- pass
-
def tearDown(self):
Vault.deleteTutorial(self.tutorial_id)
@@ -113,6 +112,8 @@ class ResourceTranslatorTests(unittest.TestCase):
assert getattr(res_action, "resource").type == "file", "Resource was not converted to file"
+ assert res_action.resource.default == Vault.get_resource_path(self.tutorial_id, self.res_name), "Transformed resource path is not the same as the one given by the vault"
+
def test_recursive_translate(self):
nested_action = NestedResource()
@@ -127,3 +128,4 @@ class ResourceTranslatorTests(unittest.TestCase):
for container in list_action.nested_list:
assert getattr(container, "resource").type == "file", "Element of list was not converted properly"
+