def setUp(self): self.os = MockOs() self.file = MockFile() self.sys = MockSys(self.file) self.termios = MockTermios() self.fcntl = MockFcntl() self.char_reader = CharReader(self.os, self.sys, self.termios, self.fcntl)
def setUp(self): self.os=MockOs() self.file=MockFile() self.sys=MockSys(self.file) self.termios=MockTermios() self.fcntl=MockFcntl() self.char_reader = CharReader(self.os, self.sys, self.termios, self.fcntl)
class Test(unittest.TestCase): def setUp(self): self.os = MockOs() self.file = MockFile() self.sys = MockSys(self.file) self.termios = MockTermios() self.fcntl = MockFcntl() self.char_reader = CharReader(self.os, self.sys, self.termios, self.fcntl) def test_getchGetsNone(self): c = self.char_reader.get_char() self.assertEquals(None, c) def test_getchGetsException(self): c = self.char_reader.get_char() self.assertEquals(None, c) def test_getchGetsChar(self): self.file.char = 'a' c = self.char_reader.get_char() self.assertEquals('a', c) def test_setup_terminal_for_char_read(self): self.char_reader.setup_terminal_for_char_read() def test_reset_terminal_options(self): self.char_reader.reset_terminal_options()
class Test(unittest.TestCase): def setUp(self): self.os=MockOs() self.file=MockFile() self.sys=MockSys(self.file) self.termios=MockTermios() self.fcntl=MockFcntl() self.char_reader = CharReader(self.os, self.sys, self.termios, self.fcntl) def test_getchGetsNone(self): c = self.char_reader.get_char() self.assertEquals(None, c) def test_getchGetsException(self): c = self.char_reader.get_char() self.assertEquals(None, c) def test_getchGetsChar(self): self.file.char='a' c = self.char_reader.get_char() self.assertEquals('a', c) def test_setup_terminal_for_char_read(self): self.char_reader.setup_terminal_for_char_read() def test_reset_terminal_options(self): self.char_reader.reset_terminal_options()
def setUp(self): self.mock_telnet = MockTelnet() self.mock_os = MockOs() self.mock_file = MockFile() self.mock_file.char = 'q' self.mock_time = MockTime() self.mock_sys = MockSys(self.mock_file) self.mock_termios = MockTermios() self.mock_fcntl = MockFcntl() self.beanstalkd = Beanstalkd(self.mock_telnet, '', '') self.stats = BeanstalkdStats(self.beanstalkd) self.char_reader = CharReader(self.mock_os, self.mock_sys, self.mock_termios, self.mock_fcntl) self.screen_printer = ScreenPrinter(self.mock_os, self.mock_sys) self.console = Console(Clock(self.mock_time), self.char_reader, self.screen_printer, self.stats)