<s> import unittest <EOL> from test . asserting . policy import PolicyAssertion , get_fixture_path <EOL> from vint . linting . level import Level <EOL> from vint . linting . policy . prohibit_autocmd_with_no_group import ProhibitAutocmdWithNoGroup <EOL> VALID_VIM_SCRIPT_WITH_AUGROUP = get_fixture_path ( <EOL> '<STR_LIT>' <EOL> ) <EOL> VALID_VIM_SCRIPT_WITH_GROUP_PARAM = get_fixture_path ( <EOL> '<STR_LIT>' <EOL> ) <EOL> INVALID_VIM_SCRIPT = get_fixture_path ( <EOL> '<STR_LIT>' <EOL> ) <EOL> class TestProhibitAutocmdWithNoGroup ( PolicyAssertion , unittest . TestCase ) : <EOL> def create_violation ( self , line_number , path ) : <EOL> return { <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : Level . WARNING , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : line_number , <EOL> '<STR_LIT>' : <NUM_LIT:1> , <EOL> '<STR_LIT:path>' : path <EOL> } <EOL> } <EOL> def test_get_violation_if_found_with_valid_file_with_augroup ( self ) : <EOL> self . assertFoundNoViolations ( VALID_VIM_SCRIPT_WITH_AUGROUP , <EOL> ProhibitAutocmdWithNoGroup ) <EOL> def test_get_violation_if_found_with_valid_file_with_group_param ( self ) : <EOL> self . assertFoundNoViolations ( VALID_VIM_SCRIPT_WITH_GROUP_PARAM , <EOL> ProhibitAutocmdWithNoGroup ) <EOL> def test_get_violation_if_found_with_invalid_file ( self ) : <EOL> expected_violations = [ <EOL> self . create_violation ( <NUM_LIT:1> , INVALID_VIM_SCRIPT ) , <EOL> self . create_violation ( <NUM_LIT:6> , INVALID_VIM_SCRIPT ) , <EOL> ] <EOL> self . assertFoundViolationsEqual ( INVALID_VIM_SCRIPT , <EOL> ProhibitAutocmdWithNoGroup , <EOL> expected_violations ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
