def test_analysis_profile_description_validation(): """ Test to validate profile description.""" profile = AnalysisProfile(name=fauxfactory.gen_alphanumeric(), description="", profile_type=AnalysisProfile.HOST_TYPE, files=files_list) with pytest.raises(AssertionError): profile.create() # Should still be on the form page after create method raises exception view = profile.create_view(AnalysisProfileAddView) assert view.is_displayed view.flash.assert_message("Description can't be blank") view.cancel.click()
def test_analysis_profile_item_validation(): """ Test to validate analysis profile items.""" profile_name = fauxfactory.gen_alphanumeric() profile = AnalysisProfile(name=profile_name, description=profile_name, profile_type=AnalysisProfile.HOST_TYPE) with pytest.raises(AssertionError): profile.create() # Should still be on the form page after create method raises exception view = profile.create_view(AnalysisProfileAddView) assert view.is_displayed view.flash.assert_message("At least one item must be entered to create Analysis Profile") view.cancel.click()
def test_analysis_profile_duplicate_name(): """ Test to validate duplicate profiles name.""" profile = AnalysisProfile(name=fauxfactory.gen_alphanumeric(), description=fauxfactory.gen_alphanumeric(), profile_type=AnalysisProfile.VM_TYPE, categories=categories_list) profile.create() with pytest.raises(AssertionError): profile.create() # Should still be on the form page after create method raises exception view = profile.create_view(AnalysisProfileAddView) assert view.is_displayed view.flash.assert_message("Name has already been taken") view.cancel.click()