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)
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()
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()
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')