From 5491c551a2f88dbda852bc0e9d0c5406019e2be8 Mon Sep 17 00:00:00 2001 From: mike Date: Fri, 06 Nov 2009 05:13:59 +0000 Subject: LP 448319 : Add a resource translation layer for tutorial execution --- (limited to 'tests/vaulttests.py') diff --git a/tests/vaulttests.py b/tests/vaulttests.py index 48869a7..ca61225 100644 --- a/tests/vaulttests.py +++ b/tests/vaulttests.py @@ -270,20 +270,19 @@ class VaultInterfaceTest(unittest.TestCase): assert os.path.isfile(image_path), 'cannot find the test image file' # Create and save a tutorial - tutorial = Tutorial('test', self.fsm) - Vault.saveTutorial(tutorial, self.test_metadata_dict) + Vault.saveTutorial(self.fsm, self.test_metadata_dict) bundler = TutorialBundler(self.save_test_guid) tuto_path = bundler.get_tutorial_path(self.save_test_guid) # add the ressource to the tutorial - ressource_id = Vault.add_ressource(self.save_test_guid, image_path) + ressource_id = Vault.add_resource(self.save_test_guid, image_path) # Check that the image file is now in the vault assert os.path.isfile(os.path.join(tuto_path, 'ressources', ressource_id)), 'image file not found in vault' # Check if get_ressource_path Vault interface function is working - vault_path = Vault.get_ressource_path(self.save_test_guid, ressource_id) + vault_path = Vault.get_resource_path(self.save_test_guid, ressource_id) assert os.path.isfile(vault_path), 'path returned is not a file' basename, extension = os.path.splitext(vault_path) @@ -291,14 +290,10 @@ class VaultInterfaceTest(unittest.TestCase): # Delete the ressource - Vault.delete_ressource(self.save_test_guid, ressource_id) + Vault.delete_resource(self.save_test_guid, ressource_id) # Check that the ressource is not in the vault anymore assert os.path.isfile(os.path.join(tuto_path, 'ressources', ressource_id)) == False, 'image file found in vault when it should have been deleted.' - - - - def tearDown(self): folder = os.path.join(os.getenv("HOME"),".sugar", 'default', 'tutorius', 'data'); -- cgit v0.9.1