From d667a0a9b02f9768c8b80ce0717ddc05d1cd1e2b Mon Sep 17 00:00:00 2001 From: JCTutorius Date: Thu, 05 Nov 2009 23:01:32 +0000 Subject: Middle of ciding update_metatdata --- (limited to 'tests') diff --git a/tests/vaulttests.py b/tests/vaulttests.py index c6bd852..9c51f85 100644 --- a/tests/vaulttests.py +++ b/tests/vaulttests.py @@ -259,6 +259,38 @@ class VaultInterfaceTest(unittest.TestCase): # TODO : Compare the initial and reloaded metadata when vault.Query() will accept specifc argument # (so we can specifiy that we want only the metadata for this particular tutorial + def test_update_metadata(self): + """ + This test verify that the vault interface funciton update_metadata succesfully update a tutorial metadata. + """ + pass + + + def test_get_tutorial_archive(self): + """ + This test verify that the vault interface function get_tutorial_archive zip a tutorial and + return the zipped archive object succesfully. + """ + # Create and save a tutorial + tutorial = Tutorial('test') + Vault.saveTutorial(tutorial, self.test_metadata_dict) + + bundler = TutorialBundler(self.save_test_guid) + + # Test get_tutorial_archive() + archive_object = Vault.get_tutorial_archive(self.save_test_guid) + + # Write the archive data as a new file + zip_path = str(self.save_test_guid) + '_test_.zip' + file = open(zip_path, 'wt') + file.write(archive_object) + file.close() + + # Test if new zip is valid + assert zipfile.is_zipfile(zip_path) + # Remove test file + os.remove(zip_path) + def test_add_delete_get_path_resource(self): """ -- cgit v0.9.1