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/vaulttests.py32
1 files changed, 32 insertions, 0 deletions
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):
"""