~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commands.py

  • Committer: Martin Packman
  • Date: 2012-01-05 09:50:04 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6426.
  • Revision ID: martin.packman@canonical.com-20120105095004-mia9xb7y0efmto0v
Merge bzr.dev to resolve conflicts in bzrlib.builtins

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    config,
25
25
    errors,
26
26
    option,
27
 
    symbol_versioning,
28
27
    tests,
29
28
    )
30
29
from bzrlib.commands import display_command
91
90
        self.assertContainsRe(c.get_help_text(), '--foo')
92
91
 
93
92
 
 
93
class TestInsideCommand(tests.TestCaseInTempDir):
 
94
 
 
95
    def test_command_see_config_overrides(self):
 
96
        def run(cmd):
 
97
            # We override the run() command method so we can observe the
 
98
            # overrides from inside.
 
99
            c = config.GlobalStack()
 
100
            self.assertEquals('12', c.get('xx'))
 
101
            self.assertEquals('foo', c.get('yy'))
 
102
        self.overrideAttr(builtins.cmd_rocks, 'run', run)
 
103
        self.run_bzr(['rocks', '-Oxx=12', '-Oyy=foo'])
 
104
        c = config.GlobalStack()
 
105
        # Ensure that we don't leak outside of the command
 
106
        self.assertEquals(None, c.get('xx'))
 
107
        self.assertEquals(None, c.get('yy'))
 
108
 
 
109
 
94
110
class TestInvokedAs(tests.TestCase):
95
111
 
96
112
    def test_invoked_as(self):