コード例 #1
0
def test__shares_exec_prefix():
    import sys
    old_ex = sys.exec_prefix
    try:
        sys.exec_prefix = "/foo/bar"
        assert biu._shares_exec_prefix("/foo/bar") == True
        sys.exec_prefix = "/baz/bar"
        assert biu._shares_exec_prefix("/foo/bar") == False
        sys.exec_prefix = None
        assert biu._shares_exec_prefix("/foo/bar") == False
    finally:
        sys.exec_prefix = old_ex
コード例 #2
0
ファイル: test_util.py プロジェクト: jakirkham/bokeh
def test__shares_exec_prefix():
    import sys
    old_ex = sys.exec_prefix
    try:
        sys.exec_prefix = "/foo/bar"
        assert biu._shares_exec_prefix("/foo/bar") == True
        sys.exec_prefix = "/baz/bar"
        assert biu._shares_exec_prefix("/foo/bar") == False
        sys.exec_prefix = None
        assert biu._shares_exec_prefix("/foo/bar") == False
    finally:
        sys.exec_prefix = old_ex