MCPcopy Create free account
hub / github.com/ipython/ipython / test_dirops

Function test_dirops

IPython/core/tests/test_magic.py:495–511  ·  view source on GitHub ↗

Test various directory handling operations.

()

Source from the content-addressed store, hash-verified

493
494
495def 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
514def test_cd_force_quiet():

Callers

nothing calls this directly

Calls 1

magicMethod · 0.45

Tested by

no test coverage detected