def test_cd_magic():
    kernel = get_kernel()
    kernel.do_execute("%cd ~")
    assert os.getcwd() == os.path.expanduser('~'), os.getcwd()
    clear_log_text(kernel)
    kernel.do_execute('%cd')
    assert os.getcwd() in get_log_text(kernel)
dataset/ETHPy150Open Calysto/metakernel/metakernel/magics/tests/test_cd_magic.py/test_cd_magic/original