Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormike <michael.jmontcalm@gmail.com>2009-11-30 16:51:15 (GMT)
committer mike <michael.jmontcalm@gmail.com>2009-12-05 21:17:50 (GMT)
commitd9eb3274aaa6e1395c86c4dfaa488e493969857b (patch)
tree9231c0a18eb8b9efa2decb274f5a6d7c0f2ce59e /tests
parent32c62b4f0370791eb52e4ee8f9c0f1ee3058675d (diff)
LP 448319 : Translation layer tests and automatic generation of pot file (ongoing)
Diffstat (limited to 'tests')
-rw-r--r--tests/translatortests.py2
-rw-r--r--tests/vaulttests.py15
2 files changed, 13 insertions, 4 deletions
diff --git a/tests/translatortests.py b/tests/translatortests.py
index 3b5ca6f..ede7dee 100644
--- a/tests/translatortests.py
+++ b/tests/translatortests.py
@@ -129,3 +129,5 @@ class ResourceTranslatorTests(unittest.TestCase):
for container in list_action.nested_list:
assert getattr(container, "resource").type == "file", "Element of list was not converted properly"
+ def test_string_transation(self):
+ pass
diff --git a/tests/vaulttests.py b/tests/vaulttests.py
index 729d36d..fc7cd8f 100644
--- a/tests/vaulttests.py
+++ b/tests/vaulttests.py
@@ -35,7 +35,8 @@ from sugar.tutorius import addon
from sugar.tutorius.tutorial import Tutorial
from sugar.tutorius.actions import *
from sugar.tutorius.filters import *
-from sugar.tutorius.vault import Vault, XMLSerializer, Serializer, TutorialBundler
+from sugar.tutorius.vault import Vault, XMLSerializer, Serializer, TutorialBundler, \
+ LOCALIZATION_FOLDER
import sugar
@@ -69,6 +70,7 @@ class VaultInterfaceTest(unittest.TestCase):
path = os.path.join(sugar.tutorius.vault._get_store_root(), 'test_bundle_path', 'data', 'tutorius', 'data')
if os.path.isdir(path) != True:
os.makedirs(path)
+ os.mkdir(os.path.join(path, LOCALIZATION_FOLDER))
# Generate a first test GUID
self.test_guid = uuid1()
@@ -407,7 +409,7 @@ class VaultInterfaceTest(unittest.TestCase):
bundler = TutorialBundler(self.save_test_guid)
- # Add test ressources to the tutorial
+ # Add test resources to the tutorial
test_path = os.path.join(os.getenv("HOME"),".sugar", 'default', 'tutorius', 'tmp')
if os.path.isdir(test_path) == True:
shutil.rmtree(os.path.join(os.getenv("HOME"),".sugar", 'default', 'tutorius', 'tmp'))
@@ -432,8 +434,14 @@ class VaultInterfaceTest(unittest.TestCase):
assert zipfile.is_zipfile(zip_path)
# Remove test file
os.remove(zip_path)
-
+ def test_get_localization_dir(self):
+ tutorial = self.fsm
+ Vault.saveTutorial(tutorial, self.test_metadata_dict)
+ # Get the localization directory
+ l10n_dir = Vault.get_localization_dir(self.save_test_guid)
+
+ assert l10n_dir is not None, "Expected valid l10n_dir, got None"
def tearDown(self):
folder = os.path.join(os.getenv("HOME"),".sugar", 'default', 'tutorius', 'data');
@@ -447,7 +455,6 @@ class VaultInterfaceTest(unittest.TestCase):
# Restore home env variable to true value
os.environ["HOME"] = self.__old_home
-
class SerializerInterfaceTest(unittest.TestCase):
"""
For completeness' sake.