コード例 #1
0
ファイル: test_utils.py プロジェクト: witch2020/hyperopt
def test_workdir():
    fn = "test_work_dir"
    os.makedirs(fn)
    try:
        assert fn not in os.getcwd()
        with working_dir(fn):
            assert fn in os.getcwd()
        assert fn not in os.getcwd()
    finally:
        if os.path.isdir(fn):
            os.rmdir(fn)
コード例 #2
0
ファイル: test_utils.py プロジェクト: abiteboul/hyperopt
def test_workdir():
    fn = "test_work_dir"
    os.makedirs(fn)
    try:
        assert fn not in os.getcwd()
        with working_dir(fn):
            assert fn in os.getcwd()
        assert fn not in os.getcwd()
    finally:
        if os.path.isdir(fn):
            os.rmdir(fn)