Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(84)  |  Call(84)  |  Derive(0)  |  Import(0)
Fail if the two objects are unequal as determined by the '=='
operator.

src/p/e/pexpect-u-2.5.1/pexpect/tests/test_expect.py   pexpect-u(Download)
    def _before_after(self, p):
        p.timeout = 5
 
        p.expect('>>> ')
        self.assertEqual(p.after, '>>> ')
 
        p.expect('5')
        self.assertEqual(p.after, '5')
        self.assert_(p.before.startswith('list(range(4*3))'))
 
        p.expect('>>> ')
        self.assertEqual(p.after, '>>> ')
 
        p.sendline('list(range(4*3))')
        self.assertEqual(p.expect(['5,', '5,']), 0)
        p.expect('>>> ')
 
        p.sendline('list(range(4*3))')
        self.assertEqual(p.expect(['7,', '5,']), 1)

src/p/e/pexpect-u-2.5.1/pexpect/tests/test_performance.py   pexpect-u(Download)
    def plain_range(self, n):
        e = pexpect.spawn('python')
        self.assertEqual(e.expect('>>>'), 0)
        e.sendline('for n in range(1, %d+1): print n' % n)
        self.assertEqual(e.expect(r'\.{3}'), 0)
        e.sendline('')
        self.assertEqual(e.expect(['inquisition', '%d' % n]), 1)
    def window_range(self, n):
        e = pexpect.spawn('python')
        self.assertEqual(e.expect('>>>'), 0)
        e.sendline('for n in range(1, %d+1): print n' % n)
        self.assertEqual(e.expect(r'\.{3}'), 0)

src/p/e/pexpect-3.2/tests/test_performance.py   pexpect(Download)
    def plain_range(self, n):
        e = pexpect.spawn('python')
        self.assertEqual(e.expect(b'>>>'), 0)
        e.sendline(self._iter_n(n))
        self.assertEqual(e.expect(br'\.{3}'), 0)
        e.sendline(b'')
        self.assertEqual(e.expect([b'inquisition', '%d' % n]), 1)
    def window_range(self, n):
        e = pexpect.spawn('python')
        self.assertEqual(e.expect(b'>>>'), 0)
        e.sendline(self._iter_n(n))
        self.assertEqual(e.expect(r'\.{3}'), 0)

src/p/e/pexpect-3.2/tests/test_expect.py   pexpect(Download)
        p = pexpect.spawn('echo hello.?world')
        i = p.expect_exact(b'.?')
        self.assertEqual(p.before, b'hello')
        self.assertEqual(p.after, b'.?')
 
    def test_expect_timeout (self):
        p = pexpect.spawn('cat', timeout=5)
        p.expect(pexpect.TIMEOUT) # This tells it to wait for timeout.
        self.assertEqual(p.after, pexpect.TIMEOUT)
 
    def _before_after(self, p):
        p.timeout = 5
 
        p.expect(b'5')
        self.assertEqual(p.after, b'5')
        assert p.before.startswith(b'[0, 1, 2'), p.before
 
        p.expect(b'50')
        self.assertEqual(p.after, b'50')

src/p/e/pexpect-3.2/tests/test_misc.py   pexpect(Download)
    def test_read (self):
        child = pexpect.spawn('cat')
        child.sendline ("abc")
        child.sendeof()
        self.assertEqual(child.read(0), b'')
        self.assertEqual(child.read(1), b'a')
        self.assertEqual(child.read(1), b'b')
        self.assertEqual(child.read(1), b'c')
        self.assertEqual(child.read(2), b'\r\n')

src/p/e/pexpect-3.2/tests/test_winsize.py   pexpect(Download)
        if index == 0:
            self.fail("TIMEOUT -- this platform may not support sigwinch properly.\n" + str(p1))
        self.assertEqual(p1.match.group(1, 2), (b"11" ,b"22"))
        self.assertEqual(p1.getwinsize(), (11, 22))
 
        if index == 0:
            self.fail ("TIMEOUT -- this platform may not support sigwinch properly.\n" + str(p1))
        self.assertEqual(p1.match.group(1, 2), (b"24" ,b"80"))
        self.assertEqual(p1.getwinsize(), (24, 80))
 

src/p/e/pexpect-3.2/tests/test_filedescriptor.py   pexpect(Download)
        s.expect(b'This is the end of test data:')
        s.expect(pexpect.EOF)
        self.assertEqual(s.before, b' END\n')
 
    def test_maxread (self):
        s.expect ('This is the end of test data:')
        s.expect (pexpect.EOF)
        self.assertEqual(s.before, b' END\n')
 
    def test_fd_isalive (self):

src/p/e/pexpect-3.2/tests/test_isalive.py   pexpect(Download)
        p.wait()
        assert p.exitstatus is None, p.exitstatus
        self.assertEqual(p.signalstatus, signal.SIGALRM)
 
    def test_expect_isalive_dead_after_normal_termination (self):

src/p/e/pexpect-3.2/tests/test_log.py   pexpect(Download)
            lf = f.read()
        os.unlink(filename)
        self.assertEqual(lf.rstrip(), log_message.encode('ascii'))
 
    def test_log_logfile_read (self):
        os.unlink (filename)
        lf = lf.replace(_CAT_EOF, b'')
        self.assertEqual(lf, b'This is a test.\r\nThis is a test.\r\n')
 
    def test_log_logfile_send (self):
        os.unlink(filename)
        lf = lf.replace(b'\x04', b'')
        self.assertEqual(lf.rstrip(), log_message)
 
    def test_log_send_and_received (self):
        os.unlink(filename)
        lf = lf.replace(b'\x04', b'').replace(_CAT_EOF, b'')
        self.assertEqual(lf,
                b'This is a test.\nThis is a test.\r\nThis is a test.\r\n')
 

src/p/e/pexpect-3.2/tests/test_unicode.py   pexpect(Download)
        # ensure the 'send' log is correct,
        with open(filename_send, 'r', encoding='utf-8') as f:
            self.assertEqual(f.read(), msg + '\n\x04')
 
        # ensure the 'read' log is correct,
        with open(filename_read, 'r', encoding='utf-8', newline='') as f:
            output = f.read().replace(_CAT_EOF, '')
            self.assertEqual(output, (msg + '\r\n')*2 )

  1 | 2  Next