From d9eb3274aaa6e1395c86c4dfaa488e493969857b Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 30 Nov 2009 16:51:15 +0000 Subject: LP 448319 : Translation layer tests and automatic generation of pot file (ongoing) --- (limited to 'tests') 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. -- cgit v0.9.1