Exemple #1
0
def test_get_taskmanager_not_exists(dataspace):  # noqa: F811
    """This should error out"""
    with pytest.raises((KeyError, NoResultFound)):
        dataspace.get_taskmanager(taskmanager_name="no_such_task_manager")
    with pytest.raises((KeyError, NoResultFound)):
        dataspace.get_taskmanager(
            taskmanager_name="no_such_task_manager",
            taskmanager_id="11111111-1111-1111-1111-111111111111",
        )
Exemple #2
0
def test_get_taskmanager_exists(dataspace):  # noqa: F811
    """Can I get a taskmanager by name or name and uuid"""
    # should return the 'newest' instance
    result1 = dataspace.get_taskmanager(taskmanager_name="taskmanager1")
    assert result1["name"] == "taskmanager1"
    assert str(result1["taskmanager_id"]) == "11111111-1111-1111-1111-111111111111"

    result2 = dataspace.get_taskmanager(
        taskmanager_name="taskmanager1",
        taskmanager_id="11111111-1111-1111-1111-111111111111",
    )
    assert result2["name"] == "taskmanager1"
    assert str(result2["taskmanager_id"]) == "11111111-1111-1111-1111-111111111111"

    assert result1 == result2