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