~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-12-22 18:18:20 UTC
  • mfrom: (4913.2.26 2.1.0rc1-module-available)
  • Revision ID: pqm@pqm.ubuntu.com-20091222181820-qfolh2sy2nevoxxj
(jam) Switch many test features over to ModuleAvailable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 
54
54
UTF8DirReaderFeature = _UTF8DirReaderFeature()
55
55
 
56
 
TermIOSFeature = tests.ModuleAvailableFeature('termios')
 
56
term_ios_feature = tests.ModuleAvailableFeature('termios')
57
57
 
58
58
 
59
59
def _already_unicode(s):
82
82
                          dict(_dir_reader_class=_readdir_pyx.UTF8DirReader,
83
83
                               _native_to_unicode=_utf8_to_unicode)))
84
84
 
85
 
    if test__walkdirs_win32.Win32ReadDirFeature.available():
 
85
    if test__walkdirs_win32.win32_readdir_feature.available():
86
86
        try:
87
87
            from bzrlib import _walkdirs_win32
88
88
            scenarios.append(
989
989
 
990
990
    def test_osutils_binding(self):
991
991
        from bzrlib.tests import test__chunks_to_lines
992
 
        if test__chunks_to_lines.CompiledChunksToLinesFeature.available():
 
992
        if test__chunks_to_lines.compiled_chunkstolines_feature.available():
993
993
            from bzrlib._chunks_to_lines_pyx import chunks_to_lines
994
994
        else:
995
995
            from bzrlib._chunks_to_lines_py import chunks_to_lines
1181
1181
 
1182
1182
    def test_force_walkdirs_utf8_nt(self):
1183
1183
        # Disabled because the thunk of the whole walkdirs api is disabled.
1184
 
        self.requireFeature(test__walkdirs_win32.Win32ReadDirFeature)
 
1184
        self.requireFeature(test__walkdirs_win32.win32_readdir_feature)
1185
1185
        self._save_platform_info()
1186
1186
        win32utils.winver = 'Windows NT'
1187
1187
        from bzrlib._walkdirs_win32 import Win32ReadDir
1188
1188
        self.assertDirReaderIs(Win32ReadDir)
1189
1189
 
1190
1190
    def test_force_walkdirs_utf8_98(self):
1191
 
        self.requireFeature(test__walkdirs_win32.Win32ReadDirFeature)
 
1191
        self.requireFeature(test__walkdirs_win32.win32_readdir_feature)
1192
1192
        self._save_platform_info()
1193
1193
        win32utils.winver = 'Windows 98'
1194
1194
        self.assertDirReaderIs(osutils.UnicodeDirReader)
1345
1345
        self.assertEqual(expected_dirblocks, result)
1346
1346
 
1347
1347
    def test__walkdirs_utf8_win32readdir(self):
1348
 
        self.requireFeature(test__walkdirs_win32.Win32ReadDirFeature)
 
1348
        self.requireFeature(test__walkdirs_win32.win32_readdir_feature)
1349
1349
        self.requireFeature(tests.UnicodeFilenameFeature)
1350
1350
        from bzrlib._walkdirs_win32 import Win32ReadDir
1351
1351
        self._save_platform_info()
1402
1402
 
1403
1403
    def test__walkdirs_utf_win32_find_file_stat_file(self):
1404
1404
        """make sure our Stat values are valid"""
1405
 
        self.requireFeature(test__walkdirs_win32.Win32ReadDirFeature)
 
1405
        self.requireFeature(test__walkdirs_win32.win32_readdir_feature)
1406
1406
        self.requireFeature(tests.UnicodeFilenameFeature)
1407
1407
        from bzrlib._walkdirs_win32 import Win32ReadDir
1408
1408
        name0u = u'0file-\xb6'
1426
1426
 
1427
1427
    def test__walkdirs_utf_win32_find_file_stat_directory(self):
1428
1428
        """make sure our Stat values are valid"""
1429
 
        self.requireFeature(test__walkdirs_win32.Win32ReadDirFeature)
 
1429
        self.requireFeature(test__walkdirs_win32.win32_readdir_feature)
1430
1430
        self.requireFeature(tests.UnicodeFilenameFeature)
1431
1431
        from bzrlib._walkdirs_win32 import Win32ReadDir
1432
1432
        name0u = u'0dir-\u062c\u0648'
1987
1987
        self.assertEqual(None, osutils.terminal_width())
1988
1988
 
1989
1989
    def test_no_TIOCGWINSZ(self):
1990
 
        self.requireFeature(TermIOSFeature)
1991
 
        termios = TermIOSFeature.module
 
1990
        self.requireFeature(term_ios_feature)
 
1991
        termios = term_ios_feature.module
1992
1992
        # bug 63539 is about a termios without TIOCGWINSZ attribute
1993
1993
        try:
1994
1994
            orig = termios.TIOCGWINSZ