def test_pushd(self): #Function pushd #Function popd dp1 = os.getcwd().split('/') shex.pushd("..") assert(shex.peek().split('/')==dp1) dp2 = os.getcwd().split('/') shex.popd() dp3 = os.getcwd().split('/') assert(dp1==dp3) assert(dp2==dp1[:-1])
def bad_pushd(self): path = os.getcwd() shex.pushd("bad/dir") assert(path==os.getcwd())