pygobject r770 - in trunk: . gobject tests



Author: johan
Date: Tue Apr  8 19:15:55 2008
New Revision: 770
URL: http://svn.gnome.org/viewvc/pygobject?rev=770&view=rev

Log:
2008-04-08  Johan Dahlin  <jdahlin async com br>

    * gobject/option.py: Fix a typo
    * tests/test_option.py:
    Update the tests after the latest "refactoring".
    The testsuite should run fine now again, finally.



Modified:
   trunk/ChangeLog
   trunk/gobject/option.py
   trunk/tests/test_option.py

Modified: trunk/gobject/option.py
==============================================================================
--- trunk/gobject/option.py	(original)
+++ trunk/gobject/option.py	Tue Apr  8 19:15:55 2008
@@ -1,4 +1,4 @@
-# -*- Mode: Python; py-indent-offset: 4 -*-
+# -*- Mode: Python -*-
 # pygobject - Python bindings for the GObject library
 # Copyright (C) 2006  Johannes Hoelzl
 #
@@ -316,7 +316,7 @@
         largs.extend(context.parse([sys.argv[0]] + rargs))
 
     def parse_args(self, args=None, values=None):
-        old_args = args or 0
+        old_args = args or []
         try:
             options, args = optparse.OptionParser.parse_args(
                 self, args, values)

Modified: trunk/tests/test_option.py
==============================================================================
--- trunk/tests/test_option.py	(original)
+++ trunk/tests/test_option.py	Tue Apr  8 19:15:55 2008
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 
+import optparse
 import unittest
 import sys
 from StringIO import StringIO
@@ -17,6 +18,10 @@
                                      description="Option unit test")
         self.parser.add_option("-t", "--test", help="Unit test option",
                           action="store_false", dest="test", default=True)
+        self.parser.add_option("--g-fatal-warnings",
+                               action="store_true",
+                               dest="fatal_warnings",
+                               help="dummy"),
 
     def _create_group(self):
         def option_callback(option, opt, value, parser):
@@ -83,6 +88,7 @@
         self.failIf(args)
 
     def testOptionValueError(self):
+        self._create_group()
         self.assertRaises(option.OptionValueError, self.parser.parse_args,
                           ["test_option.py", "--test-integer=text"])
 
@@ -95,6 +101,7 @@
         self.assertRaises(TypeError, option.OptionGroup)
 
     def testStandardError(self):
+        self._create_group()
         sio = StringIO()
         old_stderr = sys.stderr
         sys.stderr = sio



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]