Esempio n. 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(), '/')
Esempio n. 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
Esempio n. 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
Esempio n. 4
0
def test_cd():
    with cd('/'):
        assert_equal(os.getcwd(), '/')
Esempio n. 5
0
def test_cd():
    with cd(root):
        assert os.getcwd() == root
Esempio n. 6
0
def test_cd():
    with cd(root):
        assert os.getcwd() == root