2045
2045
Attempts to run bzr from inside this class don't actually run it.
2047
We test how run_bzr actually invokes bzr in another location.
2048
Here we only need to test that it is run_bzr passes the right
2049
parameters to run_bzr.
2047
We test how run_bzr actually invokes bzr in another location. Here we
2048
only need to test that it passes the right parameters to run_bzr.
2051
2050
self.argv = list(argv)
2052
2051
self.retcode = retcode
2053
2052
self.encoding = encoding
2054
2053
self.stdin = stdin
2055
2054
self.working_dir = working_dir
2056
return self.out, self.err
2055
return self.retcode, self.out, self.err
2058
2057
def test_run_bzr_error(self):
2059
2058
self.out = "It sure does!\n"
2060
2059
out, err = self.run_bzr_error(['^$'], ['rocks'], retcode=34)
2061
2060
self.assertEqual(['rocks'], self.argv)
2062
2061
self.assertEqual(34, self.retcode)
2063
self.assertEqual(out, 'It sure does!\n')
2062
self.assertEqual('It sure does!\n', out)
2063
self.assertEquals(out, self.out)
2064
self.assertEqual('', err)
2065
self.assertEquals(err, self.err)
2065
2067
def test_run_bzr_error_regexes(self):
2067
2069
self.err = "bzr: ERROR: foobarbaz is not versioned"
2068
2070
out, err = self.run_bzr_error(
2069
["bzr: ERROR: foobarbaz is not versioned"],
2070
['file-id', 'foobarbaz'])
2071
["bzr: ERROR: foobarbaz is not versioned"],
2072
['file-id', 'foobarbaz'])
2072
2074
def test_encoding(self):
2073
2075
"""Test that run_bzr passes encoding to _run_bzr_core"""