Test various directory handling operations.
()
| 493 | |
| 494 | |
| 495 | def test_dirops(): |
| 496 | """Test various directory handling operations.""" |
| 497 | # curpath = lambda :os.path.splitdrive(os.getcwd())[1].replace('\\','/') |
| 498 | curpath = os.getcwd |
| 499 | startdir = os.getcwd() |
| 500 | ipdir = os.path.realpath(_ip.ipython_dir) |
| 501 | try: |
| 502 | _ip.magic('cd "%s"' % ipdir) |
| 503 | nt.assert_equal(curpath(), ipdir) |
| 504 | _ip.magic('cd -') |
| 505 | nt.assert_equal(curpath(), startdir) |
| 506 | _ip.magic('pushd "%s"' % ipdir) |
| 507 | nt.assert_equal(curpath(), ipdir) |
| 508 | _ip.magic('popd') |
| 509 | nt.assert_equal(curpath(), startdir) |
| 510 | finally: |
| 511 | os.chdir(startdir) |
| 512 | |
| 513 | |
| 514 | def test_cd_force_quiet(): |