From 50044c4395bfdb6bbe7f184a15b9f0e13959a235 2007-09-08 13:17:39 From: vivainio Date: 2007-09-08 13:17:39 Subject: [PATCH] update test_cd with pushd/popd --- diff --git a/test/test_cd.ipy b/test/test_cd.ipy index 2214c1b..eee6ace 100644 --- a/test/test_cd.ipy +++ b/test/test_cd.ipy @@ -1,6 +1,18 @@ +# assumes there is /tmp and /opt + +def curpath(): + cwd = os.path.splitdrive(os.getcwd())[1].replace('\\','/') + print cwd + return cwd + import os cd / -assert os.getcwd() == '/' +assert curpath() == '/' %cd /tmp +assert curpath() == '/tmp' +pushd /opt +assert curpath() == '/opt' +popd +assert curpath() == '/tmp' + -assert os.getcwd() == '/tmp'