]> granicus.if.org Git - python/commitdiff
Merged revisions 78075-78079 via svnmerge from
authorGeorg Brandl <georg@python.org>
Sun, 7 Feb 2010 13:02:10 +0000 (13:02 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 7 Feb 2010 13:02:10 +0000 (13:02 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78075 | georg.brandl | 2010-02-07 13:16:12 +0100 (So, 07 Feb 2010) | 1 line

  Fix another duplicated test method.
........
  r78076 | georg.brandl | 2010-02-07 13:19:43 +0100 (So, 07 Feb 2010) | 1 line

  Fix wrong usage of "except X, Y:".
........
  r78077 | georg.brandl | 2010-02-07 13:25:50 +0100 (So, 07 Feb 2010) | 1 line

  Fix two redefined test methods.
........
  r78078 | georg.brandl | 2010-02-07 13:27:06 +0100 (So, 07 Feb 2010) | 1 line

  Fix a redefined test method.
........
  r78079 | georg.brandl | 2010-02-07 13:34:26 +0100 (So, 07 Feb 2010) | 1 line

  Add a minimal test for fnmatchcase().
........

Lib/test/test_csv.py
Lib/test/test_fnmatch.py
Lib/test/test_functools.py
Lib/test/test_optparse.py
Lib/test/test_pep292.py

index b239f752ad312f6a091c49d447664feb9032819c..11540d4cee96aad9563c3e991c1fa8a8e5bfd3f2 100644 (file)
@@ -531,10 +531,10 @@ hammer and saw"
     def test_null(self):
         self.writerAssertEqual([], '')
 
-    def test_single(self):
+    def test_single_writer(self):
         self.writerAssertEqual([['abc']], 'abc\r\n')
 
-    def test_simple(self):
+    def test_simple_writer(self):
         self.writerAssertEqual([[1, 2, 'abc', 3, 4]], '1,2,abc,3,4\r\n')
 
     def test_quotes(self):
index b1dd6f8d89557ac72626f01d46c1a54eb83af8fe..3777098fa84e41912756349d252c128386460732 100644 (file)
@@ -44,6 +44,11 @@ class FnmatchTestCase(unittest.TestCase):
         check('\nfoo', 'foo*', False)
         check('\n', '*')
 
+    def test_fnmatchcase(self):
+        check = self.check_match
+        check('AbC', 'abc', 0)
+        check('abc', 'AbC', 0)
+
 
 def test_main():
     test_support.run_unittest(FnmatchTestCase)
index 30d419da21d32db3acda8c81df8823454e30832f..6666685587c4588ef59a03c430b19e7bacec822d 100644 (file)
@@ -43,6 +43,14 @@ class TestPartial(unittest.TestCase):
         self.assertRaises(TypeError, setattr, p, 'args', (1, 2))
         self.assertRaises(TypeError, setattr, p, 'keywords', dict(a=1, b=2))
 
+        p = self.thetype(hex)
+        try:
+            del p.__dict__
+        except TypeError:
+            pass
+        else:
+            self.fail('partial object allowed __dict__ to be deleted')
+
     def test_argument_checking(self):
         self.assertRaises(TypeError, self.thetype)     # need at least a func arg
         try:
@@ -117,15 +125,6 @@ class TestPartial(unittest.TestCase):
         self.assertRaises(ZeroDivisionError, self.thetype(f), 1, 0)
         self.assertRaises(ZeroDivisionError, self.thetype(f, y=0), 1)
 
-    def test_attributes(self):
-        p = self.thetype(hex)
-        try:
-            del p.__dict__
-        except TypeError:
-            pass
-        else:
-            self.fail('partial object allowed __dict__ to be deleted')
-
     def test_weakref(self):
         f = self.thetype(int, base=16)
         p = proxy(f)
index f27864ae46ef606bb8e28b328ac4eb5b44d860ad..5f585a6d7b9ee8a2b0039b6328a388e9c31c222a 100644 (file)
@@ -459,7 +459,7 @@ def _check_duration(option, opt, value):
             return int(value)
         else:
             return int(value[:-1]) * _time_units[value[-1]]
-    except ValueError, IndexError:
+    except (ValueError, IndexError):
         raise OptionValueError(
             'option %s: invalid duration: %r' % (opt, value))
 
index d1100ea8f62f95fa29731c92f8daaa4caebaceb2..cb8a244dc0e0ece4646623085df7b7800ed1b87b 100644 (file)
@@ -86,13 +86,6 @@ class TestTemplate(unittest.TestCase):
         s = Template('$who likes $100')
         raises(ValueError, s.substitute, dict(who='tim'))
 
-    def test_delimiter_override(self):
-        class PieDelims(Template):
-            delimiter = '@'
-        s = PieDelims('@who likes to eat a bag of @{what} worth $100')
-        self.assertEqual(s.substitute(dict(who='tim', what='ham')),
-                         'tim likes to eat a bag of ham worth $100')
-
     def test_idpattern_override(self):
         class PathPattern(Template):
             idpattern = r'[_a-z][._a-z0-9]*'
@@ -183,6 +176,12 @@ class TestTemplate(unittest.TestCase):
         raises(ValueError, s.substitute, dict(gift='bud', who='you'))
         eq(s.safe_substitute(), 'this &gift is for &{who} &')
 
+        class PieDelims(Template):
+            delimiter = '@'
+        s = PieDelims('@who likes to eat a bag of @{what} worth $100')
+        self.assertEqual(s.substitute(dict(who='tim', what='ham')),
+                         'tim likes to eat a bag of ham worth $100')
+
 
 def test_main():
     from test import test_support