summaryrefslogtreecommitdiff
path: root/test/_windows.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/_windows.py')
-rw-r--r--test/_windows.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/_windows.py b/test/_windows.py
index f812880c..879a698c 100644
--- a/test/_windows.py
+++ b/test/_windows.py
@@ -526,6 +526,8 @@ class RemoteProcessTestCase(unittest.TestCase):
test_args = ["-c", "import sys; sys.stdin.read()"]
def setUp(self):
+ env = os.environ.copy()
+ env["THINK_OF_A_NUMBER"] = str(os.getpid())
self.proc32 = get_test_subprocess([self.python32] + self.test_args,
env=env,
stdin=subprocess.PIPE)
@@ -560,6 +562,18 @@ class RemoteProcessTestCase(unittest.TestCase):
p = psutil.Process(self.proc64.pid)
self.assertEqual(p.cwd(), os.getcwd())
+ def test_environ_32(self):
+ p = psutil.Process(self.proc32.pid)
+ e = p.environ()
+ self.assertIn("THINK_OF_A_NUMBER", e)
+ self.assertEquals(e["THINK_OF_A_NUMBER"], str(os.getpid()))
+
+ def test_environ_64(self):
+ p = psutil.Process(self.proc64.pid)
+ e = p.environ()
+ self.assertIn("THINK_OF_A_NUMBER", e)
+ self.assertEquals(e["THINK_OF_A_NUMBER"], str(os.getpid()))
+
def main():
test_suite = unittest.TestSuite()