[Zope-Checkins] CVS: Zope3/lib/python/Zope/ComponentArchitecture/tests - testService.py:1.5
Barry Warsaw
barry@wooz.org
Fri, 20 Dec 2002 14:35:16 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/ComponentArchitecture/tests
In directory cvs.zope.org:/tmp/cvs-serv11652/lib/python/Zope/ComponentArchitecture/tests
Modified Files:
testService.py
Log Message:
test module cleanups:
- no docstrings in test methods (convert to comments)
- whitespace normalization
- other minor cleanups
=== Zope3/lib/python/Zope/ComponentArchitecture/tests/testService.py 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/ComponentArchitecture/tests/testService.py:1.4 Thu Aug 1 14:42:17 2002
+++ Zope3/lib/python/Zope/ComponentArchitecture/tests/testService.py Fri Dec 20 14:34:45 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
-#
+#
##############################################################################
"""
@@ -43,13 +43,13 @@
__implements__ = ITwo
class Test(CleanUp, unittest.TestCase):
-
+
def testNormal(self):
getServiceManager(None).defineService('one', IOne)
c = ServiceOne()
getServiceManager(None).provideService('one', c)
self.assertEqual(id(getService(None, 'one')), id(c))
-
+
def testFailedLookup(self):
self.assertRaises(ComponentLookupError, getService, None, 'two')
self.assertEqual(queryService(None, 'two'), None)
@@ -86,23 +86,21 @@
'two', c)
def testGetService(self):
-
- """Testing looking up a service from a service manager
- container that doesn't have a service manager."""
-
+ # Testing looking up a service from a service manager container that
+ # doesn't have a service manager.
getServiceManager(None).defineService('one', IOne)
c = ServiceOne()
getServiceManager(None).provideService('one', c)
class C: pass
foo = C()
self.assertEqual(id(getService(foo, 'one')), id(c))
-
+
def testGetServiceDefinitions(self):
- """test that the service definitions are the ones we added"""
+ # test that the service definitions are the ones we added
getServiceManager(None).defineService('one', IOne)
c = ServiceOne()
getServiceManager(None).provideService('one', c)
-
+
getServiceManager(None).defineService('two', ITwo)
d = ServiceTwo()
getServiceManager(None).provideService('two', d)
@@ -110,10 +108,12 @@
defs.sort()
self.assertEqual(defs,
[('one', IOne), ('two', ITwo)])
-
+
+
def test_suite():
- loader=unittest.TestLoader()
+ loader = unittest.TestLoader()
return loader.loadTestsFromTestCase(Test)
-if __name__=='__main__':
+
+if __name__ == '__main__':
unittest.TextTestRunner().run(test_suite())