示例#1
0
 def defaults_to_80x24_when_stdout_not_a_tty(self, ioctl, stdout):
     # Make sure stdout acts like a real stream (means failure is
     # more obvious)
     stdout.fileno.return_value = 1
     # Ensure it fails the isatty() test too
     stdout.isatty.return_value = False
     # Test
     eq_(pty_size(), (80, 24))
示例#2
0
文件: platform.py 项目: brutus/invoke
 def defaults_to_80x24_when_stdout_not_a_tty(self, ioctl, stdout):
     # Make sure stdout acts like a real stream (means failure is
     # more obvious)
     stdout.fileno.return_value = 1
     # Ensure it fails the isatty() test too
     stdout.isatty.return_value = False
     # Test
     eq_(pty_size(), (80, 24))
示例#3
0
文件: platform.py 项目: brutus/invoke
 def uses_default_when_stdout_triggers_ioctl_error(
     self, ioctl, stdout
 ):
     ioctl.side_effect = TypeError
     eq_(pty_size(), (80, 24))
示例#4
0
文件: platform.py 项目: brutus/invoke
 def uses_default_when_stdout_lacks_fileno(self, ioctl, stdout):
     # i.e. when accessing it throws AttributeError
     stdout.fileno.side_effect = AttributeError
     eq_(pty_size(), (80, 24))
示例#5
0
文件: platform.py 项目: brutus/invoke
 def calls_fcntl_with_TIOCGWINSZ(self, ioctl):
     # Test the default (Unix) implementation because that's all we
     # can realistically do here.
     pty_size()
     eq_(ioctl.call_args_list[0][0][1], termios.TIOCGWINSZ)
示例#6
0
 def uses_default_when_stdout_lacks_fileno(self, ioctl, stdout):
     # i.e. when accessing it throws AttributeError
     stdout.fileno.side_effect = AttributeError
     eq_(pty_size(), (80, 24))
     # Make sure we skipped over ioctl
     assert not ioctl.called
示例#7
0
 def calls_fcntl_with_TIOCGWINSZ(self, ioctl):
     # Test the default (Unix) implementation because that's all we
     # can realistically do here.
     pty_size()
     eq_(ioctl.call_args_list[0][0][1], termios.TIOCGWINSZ)
示例#8
0
 def uses_default_when_stdout_triggers_ioctl_error(
         self, ioctl, stdout):
     ioctl.side_effect = TypeError
     eq_(pty_size(), (80, 24))
示例#9
0
 def uses_default_when_stdout_lacks_fileno(self, ioctl, stdout):
     # i.e. when accessing it throws AttributeError
     stdout.fileno.side_effect = AttributeError
     eq_(pty_size(), (80, 24))