diff options
author | mike <michael.jmontcalm@gmail.com> | 2009-12-09 08:43:54 (GMT) |
---|---|---|
committer | mike <michael.jmontcalm@gmail.com> | 2009-12-09 08:43:54 (GMT) |
commit | b8b04164332bc7c77565c4557c5df3dbfddb4647 (patch) | |
tree | ae71211c586f699a428da9528e2f9b0a94d510b7 /tests/vaulttests.py | |
parent | bf726e19b2e61983340978b47e952c99f7945a6c (diff) | |
parent | 78e5ac76f9beed4bb0822c5fd6ee39b2a0b2b65d (diff) |
Late night fixes : Removed merge errors
Corrected localization code
- Overwrite on existing localization subfolders when saving
- Do not attempt to generate the pot file with Null string values
Diffstat (limited to 'tests/vaulttests.py')
-rw-r--r-- | tests/vaulttests.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/vaulttests.py b/tests/vaulttests.py index 1e39d8c..2fdbc5a 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. |