Example #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 = {}
Example #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 = {}
Example #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)
Example #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)
Example #5
0
def test_cluster_name_none():
    jip.config.config['cluster'] = None
    with pytest.raises(cl.ClusterImplementationError):
        cl.get(None)
Example #6
0
def test_cluster_not_found():
    with pytest.raises(cl.ClusterImplementationError):
        cl.get('unknown')
Example #7
0
def test_loading_internal_implementations(name):
    fakeBinDir = createFakeBinaries()
    assert cl.get(name) is not None
    removeFakeBinaries(fakeBinDir)
Example #8
0
def test_cluster_name_none():
    jip.config.config['cluster'] = None
    with pytest.raises(cl.ClusterImplementationError):
        cl.get(None)
Example #9
0
def test_cluster_not_found():
    with pytest.raises(cl.ClusterImplementationError):
        cl.get('unknown')
Example #10
0
def test_loading_internal_implementations(name):
    fakeBinDir = createFakeBinaries()
    assert cl.get(name) is not None
    removeFakeBinaries(fakeBinDir)
Example #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"
Example #12
0
def test_loading_internal_implementations(name):
    assert cl.get(name) is not None