<s> from debile . slave . runners . pylint import pylint , version <EOL> from debile . slave . wrappers . pylint import parse_pylint <EOL> from firehose . model import ( Analysis , Generator , Metadata ) <EOL> import unittest <EOL> import mock <EOL> class PylintTestCase ( unittest . TestCase ) : <EOL> filepath = "<STR_LIT>" <EOL> firehose_results = Analysis ( <EOL> metadata = Metadata ( <EOL> generator = Generator ( <EOL> name = '<STR_LIT>' <EOL> ) , <EOL> sut = None , <EOL> file_ = None , <EOL> stats = None ) , <EOL> results = [ ] <EOL> ) <EOL> @ mock . patch ( '<STR_LIT>' , <EOL> return_value = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <NUM_LIT:0> ) ) <EOL> def test_pylint_version ( self , mock ) : <EOL> name , ver = version ( ) <EOL> self . assertEquals ( name , '<STR_LIT>' ) <EOL> self . assertEquals ( ver , '<STR_LIT>' ) <EOL> @ mock . patch ( '<STR_LIT>' , <EOL> return_value = ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT:1> ) ) <EOL> def test_pylint_version_with_error ( self , mock ) : <EOL> self . assertRaises ( Exception , version ) <EOL> def test_pylint ( self ) : <EOL> pylint_analysis = pylint ( self . filepath , self . firehose_results ) <EOL> content = pylint_analysis [ <NUM_LIT:1> ] <EOL> self . assertTrue ( "<STR_LIT>" in content ) <EOL> self . assertTrue ( len ( content ) > <NUM_LIT:4> ) <EOL> def test_pylint_wrappers ( self ) : <EOL> pylint_analysis = pylint ( self . filepath , self . firehose_results ) <EOL> issues = parse_pylint ( pylint_analysis [ <NUM_LIT:1> ] . splitlines ( ) ) <EOL> i = <NUM_LIT:0> <EOL> for issue in issues : <EOL> if issue . location . file . givenpath == "<STR_LIT>" and issue . location . point . line == <NUM_LIT> and issue . location . point . column == <NUM_LIT:0> : <EOL> found = issue <EOL> i += <NUM_LIT:1> <EOL> print found <EOL> self . assertEquals ( found . testid , "<STR_LIT>" ) <EOL> self . assertEquals ( found . location . file . givenpath , <EOL> "<STR_LIT>" ) <EOL> self . assertEquals ( found . location . point . line , <NUM_LIT> ) <EOL> self . assertEquals ( found . location . point . column , <NUM_LIT:0> ) <EOL> self . assertEquals ( found . severity , "<STR_LIT>" ) <EOL> self . assertIsNone ( found . notes ) <EOL> self . assertIsNone ( found . customfields ) <EOL> self . assertTrue ( <EOL> "<STR_LIT>" <EOL> in found . message . text ) <EOL> self . assertTrue ( i > <NUM_LIT> ) </s>
