<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_unused_variable import ProhibitUnusedVariable <EOL> PATH_VALID_VIM_SCRIPT = get_fixture_path ( '<STR_LIT>' ) <EOL> PATH_INVALID_VIM_SCRIPT = get_fixture_path ( '<STR_LIT>' ) <EOL> class TestProhibitUnusedVariable ( PolicyAssertion , unittest . TestCase ) : <EOL> def test_get_violation_if_found_when_file_is_valid ( self ) : <EOL> self . assertFoundNoViolations ( PATH_VALID_VIM_SCRIPT , <EOL> ProhibitUnusedVariable ) <EOL> def create_violation ( self , line , column ) : <EOL> return { <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : Level . WARNING , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : line , <EOL> '<STR_LIT>' : column , <EOL> '<STR_LIT:path>' : PATH_INVALID_VIM_SCRIPT <EOL> } <EOL> } <EOL> def test_get_violation_if_found_when_file_is_invalid ( self ) : <EOL> expected_violations = [ <EOL> self . create_violation ( <NUM_LIT:2> , <NUM_LIT:5> ) , <EOL> self . create_violation ( <NUM_LIT:4> , <NUM_LIT:11> ) , <EOL> self . create_violation ( <NUM_LIT:7> , <NUM_LIT> ) , <EOL> self . create_violation ( <NUM_LIT:7> , <NUM_LIT> ) , <EOL> self . create_violation ( <NUM_LIT:11> , <NUM_LIT:9> ) , <EOL> self . create_violation ( <NUM_LIT:12> , <NUM_LIT:9> ) , <EOL> ] <EOL> self . assertFoundViolationsEqual ( PATH_INVALID_VIM_SCRIPT , <EOL> ProhibitUnusedVariable , <EOL> expected_violations ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
