Exemplo n.º 1
0
def test_zone_add_blank_description():
    zc = ZoneCollection(current_appliance)
    with error.expected("Description is required"):
        zc.create(
            name=fauxfactory.gen_alphanumeric(5),
            description=''
        )
Exemplo n.º 2
0
def test_zone_add_blank_name():
    zc = ZoneCollection(current_appliance)
    with error.expected("Name can't be blank"):
        zc.create(
            name='',
            description=fauxfactory.gen_alphanumeric(8)
        )
Exemplo n.º 3
0
def test_zone_add_cancel_validation():
    zc = ZoneCollection(current_appliance)
    # CREATE
    zc.create(
        name=fauxfactory.gen_alphanumeric(5),
        description=fauxfactory.gen_alphanumeric(8),
        cancel=True
    )
Exemplo n.º 4
0
def test_zone_change_appliance_zone(request):
    """ Tests that an appliance can be changed to another Zone """
    zc = ZoneCollection(current_appliance)
    # CREATE
    zone = zc.create(
        name=fauxfactory.gen_alphanumeric(5),
        description=fauxfactory.gen_alphanumeric(8)
    )
    request.addfinalizer(zone.delete)
    request.addfinalizer(conf.BasicInformation(appliance_zone="default").update)
    zone.create()
    basic_info = conf.BasicInformation(appliance_zone=zone.name)
    basic_info.update()
    assert zone.description == store.current_appliance.zone_description
    basic_info = conf.BasicInformation(appliance_zone="default")
    basic_info.update()
Exemplo n.º 5
0
def test_zone_crud(soft_assert):
    zc = ZoneCollection(current_appliance)
    # CREATE
    zone = zc.create(
        name=fauxfactory.gen_alphanumeric(5),
        description=fauxfactory.gen_alphanumeric(8)
    )
    soft_assert(zone.exists, "The zone {} does not exist!".format(
        zone.description
    ))
    # UPDATE
    old_desc = zone.description
    with update(zone):
        zone.description = fauxfactory.gen_alphanumeric(8)
    soft_assert(zone.exists and (old_desc != zone.description),
                "The zone {} was not updated!".format(
                    zone.description))
    # DELETE
    zone.delete()
    soft_assert(not zone.exists, "The zone {} exists!".format(
        zone.description
    ))