示例#1
0
def test_loading_internal_implementations_with_no_bins(name):
    # Hide all binaries
    original_path = os.environ['PATH']
    os.environ['PATH'] = ''

    # The test
    with pytest.raises(cl.ExecutableNotFoundError):
        cl.get(name)

    # Put the PATH variable back in place
    os.environ['PATH'] = original_path

    # Clear cluster-cache to avoid misinterpretations in later test cases
    cl._cluster_cache = {}
示例#2
0
def test_loading_internal_implementations_with_no_bins(name):
    # Hide all binaries
    original_path = os.environ['PATH']
    os.environ['PATH'] = ''

    # The test
    with pytest.raises(cl.ExecutableNotFoundError):
        cl.get(name)

    # Put the PATH variable back in place
    os.environ['PATH'] = original_path

    # Clear cluster-cache to avoid misinterpretations in later test cases
    cl._cluster_cache = {}
示例#3
0
def test_resolving_log_file_names(name, term):
    fakeBinDir = createFakeBinaries()
    Job = namedtuple('Job', 'job_id')
    j = Job(1)
    cluster = cl.get(name)
    assert cluster.resolve_log(j, "log-%s" % term) == "log-1"
    removeFakeBinaries(fakeBinDir)
示例#4
0
def test_resolving_log_file_names(name, term):
    fakeBinDir = createFakeBinaries()
    Job = namedtuple('Job', 'job_id')
    j = Job(1)
    cluster = cl.get(name)
    assert cluster.resolve_log(j, "log-%s" % term) == "log-1"
    removeFakeBinaries(fakeBinDir)
示例#5
0
def test_cluster_name_none():
    jip.config.config['cluster'] = None
    with pytest.raises(cl.ClusterImplementationError):
        cl.get(None)
示例#6
0
def test_cluster_not_found():
    with pytest.raises(cl.ClusterImplementationError):
        cl.get('unknown')
示例#7
0
def test_loading_internal_implementations(name):
    fakeBinDir = createFakeBinaries()
    assert cl.get(name) is not None
    removeFakeBinaries(fakeBinDir)
示例#8
0
def test_cluster_name_none():
    jip.config.config['cluster'] = None
    with pytest.raises(cl.ClusterImplementationError):
        cl.get(None)
示例#9
0
def test_cluster_not_found():
    with pytest.raises(cl.ClusterImplementationError):
        cl.get('unknown')
示例#10
0
def test_loading_internal_implementations(name):
    fakeBinDir = createFakeBinaries()
    assert cl.get(name) is not None
    removeFakeBinaries(fakeBinDir)
示例#11
0
def test_resolving_log_file_names(name, term):
    Job = namedtuple('Job', 'job_id')
    j = Job(1)
    cluster = cl.get(name)
    assert cluster.resolve_log(j, "log-%s" % term) == "log-1"
示例#12
0
def test_loading_internal_implementations(name):
    assert cl.get(name) is not None