/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Martin Pool
  • Date: 2010-06-11 06:33:15 UTC
  • mto: This revision was merged to the branch mainline in revision 5296.
  • Revision ID: mbp@canonical.com-20100611063315-cba8kkz8zzeh8y37
ScriptRunner strips consistent leading indentation from scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
        shape = sorted(os.listdir('.'))
185
185
        self.assertEquals(['A', 'B'], shape)
186
186
 
187
 
    def test_rename_error(self):
188
 
        # We wrap os.rename to make it give an error including the filenames
189
 
        # https://bugs.launchpad.net/bzr/+bug/491763
190
 
        err = self.assertRaises(OSError, osutils.rename,
191
 
            'nonexistent', 'target')
192
 
        self.assertContainsString(str(err), 'nonexistent')
193
 
 
194
187
 
195
188
class TestRandChars(tests.TestCase):
196
189
 
1071
1064
        self.assertExpectedBlocks(expected_dirblocks[1:], result)
1072
1065
 
1073
1066
    def test_walkdirs_os_error(self):
1074
 
        # <https://bugs.edge.launchpad.net/bzr/+bug/338653>
 
1067
        # <https://bugs.launchpad.net/bzr/+bug/338653>
1075
1068
        # Pyrex readdir didn't raise useful messages if it had an error
1076
1069
        # reading the directory
1077
1070
        if sys.platform == 'win32':
1917
1910
 
1918
1911
class TestTerminalWidth(tests.TestCase):
1919
1912
 
 
1913
    def setUp(self):
 
1914
        tests.TestCase.setUp(self)
 
1915
        self._orig_terminal_size_state = osutils._terminal_size_state
 
1916
        self._orig_first_terminal_size = osutils._first_terminal_size
 
1917
        self.addCleanup(self.restore_osutils_globals)
 
1918
        osutils._terminal_size_state = 'no_data'
 
1919
        osutils._first_terminal_size = None
 
1920
 
 
1921
    def restore_osutils_globals(self):
 
1922
        osutils._terminal_size_state = self._orig_terminal_size_state
 
1923
        osutils._first_terminal_size = self._orig_first_terminal_size
 
1924
        
1920
1925
    def replace_stdout(self, new):
1921
1926
        self.overrideAttr(sys, 'stdout', new)
1922
1927