Example #1
0
def test_ip_max_character_validation():
    """Test to validate max character for ip address field"""
    prov = provider.VMwareProvider(name=generate_random_string(size=5),
                                   hostname=generate_random_string(size=5),
                                   ip_address='10.10.10.12')
    prov.create()
    prov.delete(cancel=False)
Example #2
0
def test_host_name_required_validation():
    """Test to validate the hostname while adding a provider"""
    prov = provider.VMwareProvider(name=generate_random_string(size=5),
                                   hostname=None,
                                   ip_address='10.10.10.10')

    with error.expected("Host Name can't be blank"):
        prov.create()
Example #3
0
def test_ip_required_validation():
    """Test to validate the ip address while adding a provider"""
    prov = provider.VMwareProvider(name=generate_random_string(size=5),
                                   hostname=generate_random_string(size=5),
                                   ip_address=None)

    with error.expected("IP Address can't be blank"):
        prov.create()
Example #4
0
def test_add_cancelled_validation():
    """Tests that the flash message is correct when add is cancelled."""
    prov = provider.VMwareProvider()
    prov.create(cancel=True)
    flash.assert_message_match(
        'Add of new Infrastructure Provider was cancelled by the user')