~parthm/bzr/164450-push-pull-tags

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_too_much.py

terminal_width can now returns None.

* bzrlib/win32utils.py:
(get_console_size): Fix typo in comment.

* bzrlib/ui/text.py:
(TextProgressView._show_line): Handle the no terminal present case.

* bzrlib/tests/test_osutils.py:
(TestTerminalWidth): Update tests.

* bzrlib/tests/blackbox/test_too_much.py:
Fix some imports.
(OldTests.test_bzr): Handle the no terminal present case.

* bzrlib/tests/__init__.py:
(VerboseTestResult.report_test_start): Handle the no terminal
present case.

* bzrlib/status.py:
(show_pending_merges): Handle the no terminal present case.
(show_pending_merges.show_log_message): Factor out some
code. Handle the no terminal present case.

* bzrlib/osutils.py:
(terminal_width): Return None if no precise value can be found.

* bzrlib/log.py:
(LineLogFormatter.__init__): Handle the no terminal present case.
(LineLogFormatter.truncate): Accept None as max_len meaning no
truncation.
(LineLogFormatter.log_string): 

* bzrlib/help.py:
(_help_commands_to_text): Handle the no terminal present case.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    )
45
45
from bzrlib.branch import Branch
46
46
from bzrlib.errors import BzrCommandError
47
 
from bzrlib.osutils import (
48
 
    has_symlinks,
49
 
    pathjoin,
50
 
    terminal_width,
51
 
    )
52
47
from bzrlib.tests.http_utils import TestCaseWithWebserver
53
48
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
54
49
from bzrlib.tests.blackbox import ExternalBase
87
82
        os.rmdir('revertdir')
88
83
        self.run_bzr('revert')
89
84
 
90
 
        if has_symlinks():
 
85
        if osutils.has_symlinks():
91
86
            os.symlink('/unlikely/to/exist', 'symlink')
92
87
            self.run_bzr('add symlink')
93
88
            self.run_bzr('commit -m f')
374
369
        self.run_bzr('init')
375
370
 
376
371
        self.assertIsSameRealPath(self.run_bzr('root')[0].rstrip(),
377
 
                                  pathjoin(self.test_dir, 'branch1'))
 
372
                                  osutils.pathjoin(self.test_dir, 'branch1'))
378
373
 
379
374
        progress("status of new file")
380
375
 
443
438
 
444
439
        log_out = self.run_bzr('log --line')[0]
445
440
        # determine the widest line we want
446
 
        max_width = terminal_width() - 1
447
 
        for line in log_out.splitlines():
448
 
            self.assert_(len(line) <= max_width, len(line))
 
441
        max_width = osutils.terminal_width()
 
442
        if max_width is not None:
 
443
            for line in log_out.splitlines():
 
444
                self.assert_(len(line) <= max_width - 1, len(line))
449
445
        self.assert_("this is my new commit and" not in log_out)
450
446
        self.assert_("this is my new commit" in log_out)
451
447
 
462
458
 
463
459
        self.run_bzr('info')
464
460
 
465
 
        if has_symlinks():
 
461
        if osutils.has_symlinks():
466
462
            progress("symlinks")
467
463
            mkdir('symlinks')
468
464
            chdir('symlinks')