# HG changeset patch # User Pawel Solyga # Date 1233141718 0 # Node ID 9633a6a5e5f92ce90926aa9786d7ed75b17bf3e5 # Parent e93271e9c70e0aa82e1b2144d1a8e7e098d75cc7 Style and import sorting fixes in tests modules. Patch by: Pawel Solyga Reviewed by: to-be-reviewed diff -r e93271e9c70e -r 9633a6a5e5f9 tests/app/soc/cache/test_base.py --- a/tests/app/soc/cache/test_base.py Wed Jan 28 11:15:32 2009 +0000 +++ b/tests/app/soc/cache/test_base.py Wed Jan 28 11:21:58 2009 +0000 @@ -28,7 +28,7 @@ class CacheDecoratorTest(unittest.TestCase): - """Tests that the @cache decorator caches the result + """Tests that the @cache decorator caches the result. """ def setUp(self): @@ -53,14 +53,14 @@ memcache.add('answer_to_life', 42) def testMemcache(self): - """Santiy check to see if memcache is working + """Sanity check to see if memcache is working. """ memcache.add('answer_to_life', 42) self.assertEqual(memcache.get('answer_to_life'), 42) def testSidebarCaching(self): - """Test that the caching decorator caches + """Test that the caching decorator caches. """ self.failOnSecondCall() diff -r e93271e9c70e -r 9633a6a5e5f9 tests/app/soc/cache/test_sidebar.py --- a/tests/app/soc/cache/test_sidebar.py Wed Jan 28 11:15:32 2009 +0000 +++ b/tests/app/soc/cache/test_sidebar.py Wed Jan 28 11:21:58 2009 +0000 @@ -20,16 +20,16 @@ ] +import unittest + from google.appengine.api import users from google.appengine.api import memcache -import unittest - from soc.cache import sidebar class SidebarCacheTest(unittest.TestCase): - """Tests that the sidebar properly uses caching + """Tests that the sidebar properly uses caching. """ def setUp(self): @@ -40,32 +40,32 @@ memcache.flush_all() def testGetCurrentUser(self): - """Santiy check to see if get_current_user returns same value + """Sanity check to see if get_current_user returns same value. """ self.assertEqual(self.user, users.get_current_user()) def testKey(self): - """Test that the key method returns a unique key + """Test that the key method returns a unique key. """ self.assertEqual("sidebar_for_users.User(email='test@example.com')", sidebar.key(self.user)) def testGet(self): - """Test that get without setting something returns None + """Test that get without setting something returns None. """ self.assertEqual(None, sidebar.get()) def testGetPut(self): - """Test that getting after putting gives back what you put in + """Test that getting after putting gives back what you put in. """ sidebar.put(42) self.assertEqual(42, sidebar.get()) def testFlush(self): - """Test that getting after putting and flushing returns None + """Test that getting after putting and flushing returns None. """ sidebar.put(42) @@ -73,7 +73,7 @@ self.assertEqual(None, sidebar.get()) def testCache(self): - """Test that the result of a cached sidebar is cached + """Test that the result of a cached sidebar is cached. """ @sidebar.cache diff -r e93271e9c70e -r 9633a6a5e5f9 tests/app/soc/views/sidebar/test_sidebar.py --- a/tests/app/soc/views/sidebar/test_sidebar.py Wed Jan 28 11:15:32 2009 +0000 +++ b/tests/app/soc/views/sidebar/test_sidebar.py Wed Jan 28 11:21:58 2009 +0000 @@ -27,12 +27,13 @@ from soc.views.sitemap import sidebar + class SidebarTest(unittest.TestCase): def setUp(self): pass def testSidebarCallbacksAreAdded(self): - """Test that the sidebar callbacks are added when importing 'build' + """Test that the sidebar callbacks are added when importing 'build'. """ self.assertEqual([], sidebar.SIDEBAR) @@ -40,7 +41,7 @@ self.assertNotEqual([], sidebar.SIDEBAR) def testSidebarBuilds(self): - """test that the sidebar builds and does not return None + """Test that the sidebar builds and does not return None. """ self.assertNotEqual(None, sidebar.getSidebar())