Rev 3607: Fixups for test_options due to the changes to cmd_commit - insta-review by spiv. in http://people.ubuntu.com/~robertc/baz2.0/integration

Robert Collins robertc at robertcollins.net
Tue Aug 5 01:43:33 BST 2008


At http://people.ubuntu.com/~robertc/baz2.0/integration

------------------------------------------------------------
revno: 3607
revision-id: robertc at robertcollins.net-20080805004328-ilb5p3l9lbmix8oe
parent: robertc at robertcollins.net-20080805000619-bfje55v540epfkvr
committer: Robert Collins <robertc at robertcollins.net>
branch nick: integration
timestamp: Tue 2008-08-05 10:43:28 +1000
message:
  Fixups for test_options due to the changes to cmd_commit - insta-review by spiv.
modified:
  bzrlib/tests/test_options.py   testoptions.py-20051014093702-96457cfc86319a8f
=== modified file 'bzrlib/tests/test_options.py'
--- a/bzrlib/tests/test_options.py	2007-09-03 01:50:29 +0000
+++ b/bzrlib/tests/test_options.py	2008-08-05 00:43:28 +0000
@@ -17,15 +17,12 @@
 import re
 
 from bzrlib import (
-    builtins,
     bzrdir,
     commands,
     errors,
     option,
-    repository,
-    symbol_versioning,
     )
-from bzrlib.builtins import cmd_commit, cmd_log, cmd_status
+from bzrlib.builtins import cmd_commit
 from bzrlib.commands import Command, parse_args
 from bzrlib.tests import TestCase
 from bzrlib.repofmt import knitrepo
@@ -41,16 +38,18 @@
 
     def test_parse_args(self):
         """Option parser"""
-        eq = self.assertEquals
-        eq(parse_args(cmd_commit(), ['--help']),
-           ([], {'fixes': [], 'help': True}))
-        eq(parse_args(cmd_commit(), ['--message=biter']),
-           ([], {'fixes': [], 'message': 'biter'}))
+        # XXX: Using cmd_commit makes these tests overly sensitive to changes
+        # to cmd_commit, when they are meant to be about option parsing in
+        # general.
+        self.assertEqual(parse_args(cmd_commit(), ['--help']),
+           ([], {'exclude': [], 'fixes': [], 'help': True}))
+        self.assertEqual(parse_args(cmd_commit(), ['--message=biter']),
+           ([], {'exclude': [], 'fixes': [], 'message': 'biter'}))
 
     def test_no_more_opts(self):
         """Terminated options"""
-        self.assertEquals(parse_args(cmd_commit(), ['--', '-file-with-dashes']),
-                          (['-file-with-dashes'], {'fixes': []}))
+        self.assertEqual(parse_args(cmd_commit(), ['--', '-file-with-dashes']),
+                          (['-file-with-dashes'], {'exclude': [], 'fixes': []}))
 
     def test_option_help(self):
         """Options have help strings."""
@@ -67,7 +66,7 @@
     def test_option_arg_help(self):
         """Help message shows option arguments."""
         out, err = self.run_bzr('help commit')
-        self.assertEquals(err, '')
+        self.assertEqual(err, '')
         self.assertContainsRe(out, r'--file[ =]MSGFILE')
 
     def test_unknown_short_opt(self):
@@ -81,8 +80,7 @@
 
     def test_allow_dash(self):
         """Test that we can pass a plain '-' as an argument."""
-        self.assertEqual(
-            (['-'], {'fixes': []}), parse_args(cmd_commit(), ['-']))
+        self.assertEqual((['-']), parse_args(cmd_commit(), ['-'])[0])
 
     def parse(self, options, args):
         parser = option.get_optparser(dict((o.name, o) for o in options))




More information about the bazaar-commits mailing list