def random_vm_condition(): cond = explorer.VMCondition( fauxfactory.gen_alphanumeric(), expression="fill_field(VM and Instance : CPU Limit, =, 20)", scope="fill_count(VM and Instance.Files, >, 150)") cond.create() yield cond cond.delete()
def random_vm_condition(): cond = explorer.VMCondition( randomness.generate_random_string(), expression="fill_field(VM and Instance : CPU Limit, =, 20)", scope="fill_count(VM and Instance.Files, >, 150)" ) cond.create() yield cond cond.delete()
def test_vm_condition_crud(soft_assert): condition = explorer.VMCondition( randomness.generate_random_string(), expression="fill_field(VM and Instance : CPU Limit, =, 20)", scope="fill_count(VM and Instance.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("vm_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 ))