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

All Samples(62)  |  Call(62)  |  Derive(0)  |  Import(0)
Fail immediately, with the given message.

src/p/e/pexpect-3.2/tests/test_isalive.py   pexpect(Download)
        p = pexpect.spawn('sleep 3')
        if not p.isalive():
            self.fail ('Child process is not alive. It should be.')
        time.sleep(1)
        p.wait()
        if p.isalive():
            self.fail ('Child process is not dead. It should be.')
        p = pexpect.spawn('sleep 3')
        if not p.isalive():
            self.fail ('Child process is not alive. It should be.')
            pass
        else:
            self.fail ('Should have raised ExceptionPython because you can\'t call wait on a dead process.')
 
    def test_signal_wait(self):
        time.sleep(1) # allow kernel status time to catch up with state.
        if p.isalive():
            self.fail ('Child process is not dead. It should be.')
 
    def test_expect_isalive_dead_after_SIGINT (self):

src/p/e/pexpect-u-2.5.1/pexpect/tests/test_isalive.py   pexpect-u(Download)
        p = pexpect.spawn('sleep 3')
        if not p.isalive():
            self.fail ('Child process is not alive. It should be.')
        time.sleep(1)
        p.wait()
        if p.isalive():
            self.fail ('Child process is not dead. It should be.')
        p = pexpect.spawn('sleep 3')
        if not p.isalive():
            self.fail ('Child process is not alive. It should be.')
            pass
        else:
            self.fail ('Should have raised ExceptionPython because you can\'t call wait on a dead process.')
 
    def test_expect_isalive_dead_after_normal_termination (self):
        p = pexpect.spawn('ls')
        p.expect(pexpect.EOF)
        time.sleep(1) # allow kernel status time to catch up with state.
        if p.isalive():
            self.fail ('Child process is not dead. It should be.')

src/p/e/pexpect-u-2.5.1/pexpect/tests/test_expect.py   pexpect-u(Download)
            pass
        else:
            self.fail ('Expected an EOF exception.')
 
    def _before_after(self, p):

src/p/e/pexpect-3.2/tests/test_misc.py   pexpect(Download)
            pass
        else:
            self.fail ("child.isalive() should have raised a pexpect.ExceptionPexpect")
        child.terminated = 1 # Force back to valid state so __del__ won't complain
    def test_bad_arguments (self):
            pass
        else:
            self.fail ("pexpect.spawn(1) should have raised a pexpect.ExceptionPexpect.")
        try:
            p = pexpect.spawn('ls', '-la') # should really use pexpect.spawn('ls', ['-ls'])
        except TypeError:
            pass
        else:
            self.fail ("pexpect.spawn('ls', '-la') should have raised a TypeError.")
            pass
        else:
            self.fail ("read_nonblocking on closed spawn object should have raised a ValueError.")
    def test_isalive(self):
        child = pexpect.spawn('cat')
            pass
        else:
            self.fail ("child.expect({}) should have raised a TypeError")
 
    def test_env(self):

src/p/e/pexpect-3.2/tests/test_winsize.py   pexpect(Download)
                                       timeout=30)
        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))
                                       timeout=10)
        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-u-2.5.1/pexpect/tests/test_timeout_pattern.py   pexpect-u(Download)
            #print "Correctly caught TIMEOUT when raising TIMEOUT."
        else:
            self.fail('TIMEOUT not caught by an except TIMEOUT clause.')
 
    def test_pattern_printout (self):
            assert p.match_index == None
        else:
            self.fail("Did not generate a TIMEOUT exception.")
 
    def test_exp_timeout_notThrown (self):
            p.expect('Hello')
        except pexpect.TIMEOUT:
            self.fail("TIMEOUT caught when it shouldn't be raised because we match the proper pattern.")
 
    def test_stacktraceMunging (self):
        except pexpect.TIMEOUT, e:
            if e.get_trace().count("pexpect.py") != 0:
                self.fail("The TIMEOUT get_trace() referenced pexpect.py. It should only reference the caller.\n"+e.get_trace())
 
    def test_correctStackTrace (self):
        except pexpect.TIMEOUT, e:
            if e.get_trace().count("nestedFunction") == 0:
                self.fail("The TIMEOUT get_trace() did not show the call to the nestedFunction function.\n" + str(e) + "\n" + e.get_trace())
 
if __name__ == '__main__':

src/p/e/pexpect-u-2.5.1/pexpect/tests/test_misc.py   pexpect-u(Download)
            pass
        else:
            self.fail ("child.isalive() should have raised a pexpect.ExceptionPexpect")
        child.terminated = 1 # Force back to valid state so __del__ won't complain
    def test_bad_arguments (self):
            pass
        else:
            self.fail ("pexpect.spawn(1) should have raised a pexpect.ExceptionPexpect.")
        try:
            p = pexpect.spawn('ls', '-la') # should really use pexpect.spawn('ls', ['-ls'])
        except TypeError, e:
            pass
        else:
            self.fail ("pexpect.spawn('ls', '-la') should have raised a TypeError.")
            pass
        else:
            self.fail ("read_nonblocking on closed spawn object should have raised a ValueError.")
    def test_isalive(self):
        child = pexpect.spawn('cat')
            pass
        else:
            self.fail ("child.expect({}) should have raised a TypeError")
    def test_winsize(self):
        child = pexpect.spawn('cat')

src/p/e/pexpect-3.2/tests/test_expect.py   pexpect(Download)
            pass
        else:
            self.fail ('Expected an EOF exception.')
 
    def _before_after(self, p):

src/p/e/pexpect-3.2/tests/test_timeout_pattern.py   pexpect(Download)
            #print "Correctly caught TIMEOUT when raising TIMEOUT."
        else:
            self.fail('TIMEOUT not caught by an except TIMEOUT clause.')
 
    def test_pattern_printout (self):
            assert p.match_index == None
        else:
            self.fail("Did not generate a TIMEOUT exception.")
 
    def test_exp_timeout_notThrown (self):
            p.expect('Hello')
        except pexpect.TIMEOUT:
            self.fail("TIMEOUT caught when it shouldn't be raised because we match the proper pattern.")
 
    def test_stacktraceMunging (self):
            err = sys.exc_info()[1]
            if err.get_trace().count("pexpect/__init__.py") != 0:
                self.fail("The TIMEOUT get_trace() referenced pexpect.py. "
                    "It should only reference the caller.\n" + err.get_trace())
 
            err = sys.exc_info()[1]
            if err.get_trace().count("nestedFunction") == 0:
                self.fail("The TIMEOUT get_trace() did not show the call "
                    "to the nestedFunction function.\n" + str(err) + "\n"
                    + err.get_trace())

src/p/e/pexpect-u-2.5.1/pexpect/tests/test_winsize.py   pexpect-u(Download)
        index = p1.expect ([pexpect.TIMEOUT, 'SIGWINCH: \(([0-9]*), ([0-9]*)\)'], timeout=30)
        if index == 0:
            self.fail ("TIMEOUT -- this platform may not support sigwinch properly.\n" + str(p1))
        r = p1.match.group(1)
        c = p1.match.group(2)
        index = p1.expect ([pexpect.TIMEOUT, 'SIGWINCH: \(([0-9]*), ([0-9]*)\)'], timeout=10)
        if index == 0:
            self.fail ("TIMEOUT -- this platform may not support sigwinch properly.\n" + str(p1))
        r = p1.match.group(1)
        c = p1.match.group(2)

  1 | 2  Next