Пример #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