/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: Canonical.com Patch Queue Manager
  • Date: 2009-12-09 02:53:42 UTC
  • mfrom: (4873.2.3 2.1.0b4-win32-test-imports)
  • Revision ID: pqm@pqm.ubuntu.com-20091209025342-sidvxfcqdgxmuz59
(jam) Get the test suite running again on Windows, (bug #492561)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import socket
24
24
import stat
25
25
import sys
26
 
import termios
27
26
import time
28
27
 
29
28
from bzrlib import (
54
53
 
55
54
UTF8DirReaderFeature = _UTF8DirReaderFeature()
56
55
 
 
56
TermIOSFeature = tests.ModuleAvailableFeature('termios')
 
57
 
57
58
 
58
59
def _already_unicode(s):
59
60
    return s
1961
1962
        sys.stdout = None
1962
1963
        self.assertEquals(None, osutils.terminal_width())
1963
1964
 
1964
 
    def test_TIOCGWINSZ(self):
 
1965
    def test_no_TIOCGWINSZ(self):
 
1966
        self.requireFeature(TermIOSFeature)
 
1967
        termios = TermIOSFeature.module
1965
1968
        # bug 63539 is about a termios without TIOCGWINSZ attribute
1966
 
        exist = True
1967
1969
        try:
1968
1970
            orig = termios.TIOCGWINSZ
1969
1971
        except AttributeError:
1970
 
            exist = False
1971
 
 
1972
 
        def restore():
1973
 
            if exist:
 
1972
            # We won't remove TIOCGWINSZ, because it doesn't exist anyway :)
 
1973
            pass
 
1974
        else:
 
1975
            def restore():
1974
1976
                termios.TIOCGWINSZ = orig
1975
 
        self.addCleanup(restore)
1976
 
 
1977
 
        del termios.TIOCGWINSZ
 
1977
            self.addCleanup(restore)
 
1978
            del termios.TIOCGWINSZ
1978
1979
        del os.environ['BZR_COLUMNS']
1979
1980
        del os.environ['COLUMNS']
1980
 
        self.assertEquals(None, osutils.terminal_width())
 
1981
        self.assertIs(None, osutils.terminal_width())