From cea72a7d9ae41e53e00126a0528056e077eb4240 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 30 Oct 2009 15:06:59 +0000 Subject: StoreProxy ready for review --- (limited to 'tests/storetests.py') diff --git a/tests/storetests.py b/tests/storetests.py index 0d1d9af..36c623c 100644 --- a/tests/storetests.py +++ b/tests/storetests.py @@ -19,7 +19,7 @@ from tests.utils import skip, catch_unimplemented from sugar.tutorius.store import * -g_tutorial_id = '114db454-b2a1-11de-8cfc-001f5bf747dc' +g_tutorial_id = '4075' g_other_id = '47efc6ee-b2a3-11de-8cfc-001f5bf747dc' class StoreProxyTest(unittest.TestCase): @@ -39,13 +39,6 @@ class StoreProxyTest(unittest.TestCase): def test_get_tutorials(self): self.store.get_tutorials() - @catch_unimplemented - def test_get_tutorial_collection(self): - collection_list = self.store.get_tutorial_collection('top5_rating') - - assert isinstance(collection_list, list), "get_tutorial_collection should return a list" - - @catch_unimplemented def test_get_latest_version(self): version_dict = self.store.get_latest_version([]) @@ -59,15 +52,14 @@ class StoreProxyTest(unittest.TestCase): @catch_unimplemented def test_login(self): - assert self.store.login("unknown_user", "random_password") + assert self.store.login("benoit.tremblay1@gmail.com", "tutorius12") @catch_unimplemented def test_register_new_user(self): user_info = { - 'name' : "Albert", - 'last_name' : "The Tester", - 'location' : 'Mozambique', - 'email' : 'albertthetester@mozambique.org' + 'nickname' : "Albert2", + 'password' : "tutorius12", + 'email' : 'albertthetester2@mozambique.org' } assert self.store.register_new_user(user_info) @@ -77,7 +69,7 @@ class StoreProxyLoginTest(unittest.TestCase): @catch_unimplemented def setUp(self): self.store = StoreProxy() - self.store.login("unknown_user", "random_password") + self.store.login("benoit.tremblay1@gmail.com", "tutorius12") @catch_unimplemented def tearDown(self): @@ -104,20 +96,41 @@ class StoreProxyLoginTest(unittest.TestCase): def test_publish(self): # TODO : We need to send in a real tutorial loaded from # the Vault - assert self.store.publish(['This should be a real tutorial...']) + tutorial_info = { + 'name': 'newtut', + 'summary': 'This is a tutorial', + 'filename': 'test.xml', + 'homepage': 'http://google.com', + 'version': '1', + 'cat1': '17', + 'cat2': '18', + 'cat3': '' + } + assert self.store.publish('This should be a real tutorial...', tutorial_info) @catch_unimplemented def test_unpublish(self): # TODO : We need to send in a real tutorial loaded from # the Vault - self.store.publish([g_tutorial_id, 'Fake tutorial']) + #self.store.publish([g_tutorial_id, 'Fake tutorial']) assert self.store.unpublish(g_tutorial_id) @catch_unimplemented def test_update_published_tutorial(self): # TODO : Run these tests with files from the Vault - self.store.publish([g_tutorial_id, 'Fake tutorial']) + #self.store.publish([g_tutorial_id, 'Fake tutorial']) + + tutorial_info = { + 'name': 'newtut', + 'summary': 'This is a tutorial', + 'filename': 'test.xml', + 'homepage': 'http://google.com', + 'version': '1', + 'cat1': '17', + 'cat2': '18', + 'cat3': '' + } - assert self.store.update_published_tutorial(g_tutorial_id, [g_tutorial_id, 'This is an updated tutorial']) + assert self.store.update_published_tutorial(g_tutorial_id, 'This is an updated tutorial', tutorial_info) -- cgit v0.9.1