summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoah <noah@656d521f-e311-0410-88e0-e7920216d269>2003-05-08 01:37:44 +0000
committernoah <noah@656d521f-e311-0410-88e0-e7920216d269>2003-05-08 01:37:44 +0000
commit3677e721fb208749f5de4e87fb294e28442852e6 (patch)
tree518a5b6f2873746d01ac4eb7dba698cc4431c530
parent114a12ff12f526c1c8cb748939ccb197e532c5ea (diff)
downloadpexpect-3677e721fb208749f5de4e87fb294e28442852e6.tar.gz
This is the baseclass for tests. It includes a setUp and tearDown
that configures the environment for testing Pexpect. git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@195 656d521f-e311-0410-88e0-e7920216d269
-rw-r--r--pexpect/tests/PexpectTestCase.py13
-rwxr-xr-xpexpect/tests/test_winsize.py3
2 files changed, 15 insertions, 1 deletions
diff --git a/pexpect/tests/PexpectTestCase.py b/pexpect/tests/PexpectTestCase.py
new file mode 100644
index 0000000..87ea931
--- /dev/null
+++ b/pexpect/tests/PexpectTestCase.py
@@ -0,0 +1,13 @@
+
+import unittest
+import sys
+import os
+
+class PexpectTestCase(unittest.TestCase):
+ def setUp(self):
+ self.original_path = os.getcwd()
+ newpath = os.path.join (os.environ['PROJECT_PEXPECT_HOME'], 'tests')
+ os.chdir (newpath)
+ def tearDown(self):
+ os.chdir (self.original_path)
+
diff --git a/pexpect/tests/test_winsize.py b/pexpect/tests/test_winsize.py
index 672818b..ebc9505 100755
--- a/pexpect/tests/test_winsize.py
+++ b/pexpect/tests/test_winsize.py
@@ -1,9 +1,10 @@
#!/usr/bin/env python
import pexpect
import unittest
+import PexpectTestCase
import time
-class TestCaseWinsize(unittest.TestCase):
+class TestCaseWinsize(PexpectTestCase.PexpectTestCase):
def test_winsize (self):
"""
This tests that the child process can set and get the windows size.