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