Esempio n. 1
0
def random_host_condition():
    cond = explorer.HostCondition(
        randomness.generate_random_string(),
        expression="fill_count(Host.Files, >, 150)"
    )
    cond.create()
    yield cond
    cond.delete()
Esempio n. 2
0
def random_host_condition():
    if current_version() >= "5.4":
        expression = "fill_count(Host / Node.Files, >, 150)"
    else:
        expression = "fill_count(Host.Files, >, 150)"
    cond = explorer.HostCondition(
        fauxfactory.gen_alphanumeric(),
        expression=expression,
    )
    cond.create()
    yield cond
    cond.delete()
Esempio n. 3
0
def test_host_condition_crud(soft_assert):
    condition = explorer.HostCondition(
        randomness.generate_random_string(),
        expression="fill_count(Host.Files, >, 150)"
    )
    # CR
    condition.create()
    soft_assert(condition.exists, "The condition {} does not exist!".format(
        condition.description
    ))
    # U
    with update(condition):
        condition.notes = "Modified!"
    sel.force_navigate("host_condition_edit", context={"condition_name": condition.description})
    soft_assert(sel.text(condition.form.notes).strip() == "Modified!", "Modification failed!")
    # D
    condition.delete()
    soft_assert(not condition.exists, "The condition {} exists!".format(
        condition.description
    ))
Esempio n. 4
0
def test_host_condition_crud(soft_assert):
    if current_version() >= "5.4":
        expression = "fill_count(Host / Node.Files, >, 150)"
    else:
        expression = "fill_count(Host.Files, >, 150)"
    condition = explorer.HostCondition(fauxfactory.gen_alphanumeric(),
                                       expression=expression)
    # CR
    condition.create()
    soft_assert(
        condition.exists,
        "The condition {} does not exist!".format(condition.description))
    # U
    with update(condition):
        condition.notes = "Modified!"
    sel.force_navigate("host_condition_edit",
                       context={"condition_name": condition.description})
    soft_assert(
        sel.text(condition.form.notes).strip() == "Modified!",
        "Modification failed!")
    # D
    condition.delete()
    soft_assert(not condition.exists,
                "The condition {} exists!".format(condition.description))