[Zope3-checkins] CVS: Zope3/src/zope/app/content/tests - test_arguments.py:1.1.2.2
Fred L. Drake, Jr.
fred@zope.com
Tue, 24 Dec 2002 10:06:47 -0500
Update of /cvs-repository/Zope3/src/zope/app/content/tests
In directory cvs.zope.org:/tmp/cvs-serv25102
Modified Files:
Tag: NameGeddon-branch
test_arguments.py
Log Message:
minor cleanups
=== Zope3/src/zope/app/content/tests/test_arguments.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/content/tests/test_arguments.py:1.1.2.1 Mon Dec 23 14:31:30 2002
+++ Zope3/src/zope/app/content/tests/test_arguments.py Tue Dec 24 10:06:47 2002
@@ -1,14 +1,14 @@
##############################################################################
#
# Copyright (c) 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
-#
+#
##############################################################################
"""DT_SQLVar Tests
@@ -16,8 +16,8 @@
"""
import unittest
-from zope.app.content.sql import \
- Arguments, parseArguments, InvalidParameter
+
+from zope.app.content.sql import Arguments, parseArguments, InvalidParameter
class TestDT_SQLVar(unittest.TestCase):
@@ -25,19 +25,16 @@
def _compareArgumentObjects(self, result, args):
self.assertEqual(args.items(), result.items())
-
def testSimpleParseArgument(self):
args = parseArguments('arg1')
result = Arguments({'arg1': {}})
self._compareArgumentObjects(result, args)
-
def testParseArgumentWithType(self):
args = parseArguments('arg1:int')
result = Arguments({'arg1': {'type': 'int'}})
self._compareArgumentObjects(result, args)
-
def testParseArgumentWithDefault(self):
args1 = parseArguments('arg1=value')
result1 = Arguments({'arg1': {'default': 'value'}})
@@ -47,7 +44,6 @@
result2 = Arguments({'arg1': {'default': 'value'}})
self._compareArgumentObjects(result2, args2)
-
def testParseArgumentWithTypeAndDefault(self):
args1 = parseArguments('arg1:string=value')
result1 = Arguments({'arg1': {'default': 'value', 'type': 'string'}})
@@ -57,7 +53,6 @@
result2 = Arguments({'arg1': {'default': 'value', 'type': 'string'}})
self._compareArgumentObjects(result2, args2)
-
def testParseMultipleArguments(self):
args1 = parseArguments('arg1:string=value arg2')
result1 = Arguments({'arg1': {'default': 'value', 'type': 'string'},
@@ -69,19 +64,15 @@
'arg2': {}})
self._compareArgumentObjects(result2, args2)
-
def testParseErrors(self):
- self.assertRaises(InvalidParameter, parseArguments, 'arg1:""')
- self.assertRaises(InvalidParameter, parseArguments, 'arg1 = value')
- self.assertRaises(InvalidParameter, parseArguments, 'arg1="value\' ')
+ self.assertRaises(InvalidParameter, parseArguments, 'arg1:""')
+ self.assertRaises(InvalidParameter, parseArguments, 'arg1 = value')
+ self.assertRaises(InvalidParameter, parseArguments, 'arg1="value\' ')
self.assertRaises(InvalidParameter, parseArguments, 'arg1:=value')
-
def test_suite():
- suite = unittest.TestSuite()
- suite.addTest( unittest.makeSuite(TestDT_SQLVar) )
- return suite
+ return unittest.makeSuite(TestDT_SQLVar)
if __name__ == '__main__':
- unittest.TextTestRunner().run(test_suite())
+ unittest.main(defaultTest='test_suite')