diff options
author | noah <noah@656d521f-e311-0410-88e0-e7920216d269> | 2002-11-27 19:13:04 +0000 |
---|---|---|
committer | noah <noah@656d521f-e311-0410-88e0-e7920216d269> | 2002-11-27 19:13:04 +0000 |
commit | 23dcd1db08b1512368df9b85c42b23ab4d99e057 (patch) | |
tree | f6601cedfd95ce6c6cbc42fd0c0221e332af13ea | |
parent | 7ff6e639d3ec43f20d0e209bb70a8225bde8f18e (diff) | |
download | pexpect-23dcd1db08b1512368df9b85c42b23ab4d99e057.tar.gz |
More cleaning.
git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@120 656d521f-e311-0410-88e0-e7920216d269
-rw-r--r-- | pexpect/alltests.py | 28 | ||||
-rw-r--r-- | pexpect/cvs.conf | 3 | ||||
-rw-r--r-- | pexpect/cvs.ssh | 3 | ||||
-rw-r--r-- | pexpect/pexpect.py | 5 | ||||
-rw-r--r-- | pexpect/sf.net.ssh | 11 | ||||
-rw-r--r-- | pexpect/tests/platform_tests/pexqa.py (renamed from pexpect/pexqa.py) | 0 | ||||
-rwxr-xr-x | pexpect/tests/test_destructor.py | 12 | ||||
-rw-r--r-- | pexpect/tools/getkey.py (renamed from pexpect/getkey.py) | 0 | ||||
-rwxr-xr-x | pexpect/tools/hash.py (renamed from pexpect/hash.py) | 0 | ||||
-rwxr-xr-x | pexpect/tools/sfupload.py (renamed from pexpect/sfupload.py) | 0 | ||||
-rwxr-xr-x | pexpect/tools/step.py (renamed from pexpect/step.py) | 0 | ||||
-rwxr-xr-x | pexpect/tools/testall.py (renamed from pexpect/testall.py) | 21 | ||||
-rwxr-xr-x | pexpect/tools/websync (renamed from pexpect/websync) | 0 |
13 files changed, 22 insertions, 61 deletions
diff --git a/pexpect/alltests.py b/pexpect/alltests.py deleted file mode 100644 index 49bfa9a..0000000 --- a/pexpect/alltests.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python - -import unittest -import sys -sys.path.append('tests') - -modules_to_test = ( -'test_isalive', -'test_expect', -'test_ansi', -'test_command_list_split', -'test_destructor', -'test_constructor', -'test_log', -'test_missing_command', -'test_run_out_of_pty', -'test_screen' -) - -def suite(): - alltests = unittest.TestSuite() - for module in map(__import__, modules_to_test): - alltests.addTest(unittest.findTestCases(module)) - return alltests - -if __name__ == '__main__': - unittest.main(defaultTest='suite') - diff --git a/pexpect/cvs.conf b/pexpect/cvs.conf index fc0e82e..c729617 100644 --- a/pexpect/cvs.conf +++ b/pexpect/cvs.conf @@ -1,3 +1,6 @@ +# Source this file to work on the project. export CVS_RSH=ssh export CVSROOT=:ext:noah@cvs.pexpect.sourceforge.net:/cvsroot/pexpect +export PATH=$PATH:tools/ +alias sf="ssh noah@use-pr-shell1.sourceforge.net" diff --git a/pexpect/cvs.ssh b/pexpect/cvs.ssh deleted file mode 100644 index fc0e82e..0000000 --- a/pexpect/cvs.ssh +++ /dev/null @@ -1,3 +0,0 @@ -export CVS_RSH=ssh -export CVSROOT=:ext:noah@cvs.pexpect.sourceforge.net:/cvsroot/pexpect - diff --git a/pexpect/pexpect.py b/pexpect/pexpect.py index 6c004d5..899a091 100644 --- a/pexpect/pexpect.py +++ b/pexpect/pexpect.py @@ -461,7 +461,7 @@ class spawn: n = self.send(text) return n + self.send(os.linesep) - def send_eof(self): + def sendeof(self): """This sends an EOF to the child. More precisely: this sends a character which causes the pending @@ -566,7 +566,8 @@ class spawn: you send the right signal. """ # Same as os.kill, but the pid is given for you. - os.kill(self.pid, sig) + if self.isalive(): + os.kill(self.pid, sig) def interact(self, escape_character = chr(29)): """This gives control of the child process to the interactive user. diff --git a/pexpect/sf.net.ssh b/pexpect/sf.net.ssh deleted file mode 100644 index 9bbcd41..0000000 --- a/pexpect/sf.net.ssh +++ /dev/null @@ -1,11 +0,0 @@ -# This is old. Use cvs.conf instead. - -export PYTHONPATH=$PYTHONPATH:.:`pwd` -alias sf="ssh noah@use-pr-shell1.sourceforge.net" -export CVS_RSH=ssh -alias cvssf="cvs -z3 -d:ext:noah@cvs.pexpect.sourceforge.net:/cvsroot/pexpect" -alias cvsco="cvs -z3 -d:ext:noah@cvs.pexpect.sourceforge.net:/cvsroot/pexpect co pexpect" -alias cvscommit="cvs -z3 -d:ext:noah@cvs.pexpect.sourceforge.net:/cvsroot/pexpect commit" -alias cvsadd="cvs -z3 -d:ext:noah@cvs.pexpect.sourceforge.net:/cvsroot/pexpect add" -#ssh noah@use-pr-shell1.sourceforge.net "cd htdocs;rm index.html;wget http://www.noah.org/python/pexpect/index.html" -#ssh noah@use-pr-shell1.sourceforge.net "cd htdocs;tar zxvf doc.tgz" diff --git a/pexpect/pexqa.py b/pexpect/tests/platform_tests/pexqa.py index 0ba1412..0ba1412 100644 --- a/pexpect/pexqa.py +++ b/pexpect/tests/platform_tests/pexqa.py diff --git a/pexpect/tests/test_destructor.py b/pexpect/tests/test_destructor.py index 1e328cf..c676635 100755 --- a/pexpect/tests/test_destructor.py +++ b/pexpect/tests/test_destructor.py @@ -17,9 +17,8 @@ class TestCaseDestructor(unittest.TestCase): p2.expect(pexpect.EOF) p3.expect(pexpect.EOF) p4.expect(pexpect.EOF) - print p1.before, p2.before, p3.before, p4.before - print fd_t1 - + #print p1.before, p2.before, p3.before, p4.before + #print fd_t1 p1.kill(9) p2.kill(9) p3.kill(9) @@ -29,14 +28,17 @@ class TestCaseDestructor(unittest.TestCase): p3 = None p4 = None gc.collect() - time.sleep(3) # Some platforms are slow at gc... Solaris! + time.sleep(2) # Some platforms are slow at gc... Solaris! p1 = pexpect.spawn('ls -l') p2 = pexpect.spawn('ls -l') p3 = pexpect.spawn('ls -l') p4 = pexpect.spawn('ls -l') fd_t2 = (p1.child_fd,p2.child_fd,p3.child_fd,p4.child_fd) # print fd_t2 - p1.kill(9);p2.kill(9);p3.kill(9);p4.kill(9) + p1.kill(9) + p2.kill(9) + p3.kill(9) + p4.kill(9) del (p1) del (p2) del (p3) diff --git a/pexpect/getkey.py b/pexpect/tools/getkey.py index b722ac3..b722ac3 100644 --- a/pexpect/getkey.py +++ b/pexpect/tools/getkey.py diff --git a/pexpect/hash.py b/pexpect/tools/hash.py index 5da76e1..5da76e1 100755 --- a/pexpect/hash.py +++ b/pexpect/tools/hash.py diff --git a/pexpect/sfupload.py b/pexpect/tools/sfupload.py index aef303c..aef303c 100755 --- a/pexpect/sfupload.py +++ b/pexpect/tools/sfupload.py diff --git a/pexpect/step.py b/pexpect/tools/step.py index 5f281ae..5f281ae 100755 --- a/pexpect/step.py +++ b/pexpect/tools/step.py diff --git a/pexpect/testall.py b/pexpect/tools/testall.py index 8046cf7..77c83e7 100755 --- a/pexpect/testall.py +++ b/pexpect/tools/testall.py @@ -1,16 +1,13 @@ #!/usr/bin/env python -'''This module allows you to run all tests in the project where: - test directories are named 'tests' - test module names begin with 'test_' - -Testing from Unittest GUI: - type testall.py into the unittestgui.py GUI - -Testing from Command Line: - To run tests from command line just run this script. - Alternatively you can run it this way: - python /usr/local/lib/python2.1/unittest.py testall - +'''This script runs all tests in a directory. +It does not need to know about the tests ahead of time. +It recursively descends from the current directory and +automatically builds up a list of tests to run. +Only directories named 'tests' are processed. +The path to each 'tests' directory is added to the PYTHONPATH. +Only python scripts that start with 'test_' are added to +the list of scripts in the test suite. +Noah Spurrier ''' import unittest diff --git a/pexpect/websync b/pexpect/tools/websync index 32b8a27..32b8a27 100755 --- a/pexpect/websync +++ b/pexpect/tools/websync |