示例#1
0
def test_cd_bad_oldcwd():
    # Test attempting to go back to a directory that no longer exists.
    name = tempfile.mkdtemp()
    with cd(name):
        assert_equal(os.getcwd(), name)
        with cd('/'):
            assert_equal(os.getcwd(), '/')
            os.rmdir(name)
        assert_equal(os.getcwd(), '/')
示例#2
0
def test_cd_bad_oldcwd():
    # Test attempting to go back to a directory that no longer exists.
    name = tempfile.mkdtemp()
    with cd(name):
        assert os.getcwd() == os.path.realpath(name)
        with cd(root):
            assert os.getcwd() == root
            os.rmdir(name)
        assert os.getcwd() == root
示例#3
0
def test_cd_bad_oldcwd():
    # Test attempting to go back to a directory that no longer exists.
    name = tempfile.mkdtemp()
    with cd(name):
        assert os.getcwd() == os.path.realpath(name)
        with cd(root):
            assert os.getcwd() == root
            os.rmdir(name)
        assert os.getcwd() == root
示例#4
0
def test_cd():
    with cd('/'):
        assert_equal(os.getcwd(), '/')
示例#5
0
def test_cd():
    with cd(root):
        assert os.getcwd() == root
示例#6
0
def test_cd():
    with cd(root):
        assert os.getcwd() == root