review test/fakes

revert test function
move pushd and popd fakes from tests/580

(I'll squash this commit)