<s> from lintreview . review import Comment <EOL> from lintreview . review import Problems <EOL> from lintreview . tools . foodcritic import Foodcritic <EOL> from lintreview . utils import in_path <EOL> from unittest import TestCase , skipIf <EOL> from nose . tools import eq_ <EOL> critic_missing = not ( in_path ( '<STR_LIT>' ) ) <EOL> class TestFoodcritic ( TestCase ) : <EOL> needs_critic = skipIf ( critic_missing , '<STR_LIT>' ) <EOL> fixtures = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> def setUp ( self ) : <EOL> self . problems = Problems ( ) <EOL> @ needs_critic <EOL> def test_process_cookbook_pass ( self ) : <EOL> self . tool = Foodcritic ( self . problems , None , self . fixtures [ <NUM_LIT:0> ] ) <EOL> self . tool . process_files ( None ) <EOL> eq_ ( [ ] , self . problems . all ( ) ) <EOL> @ needs_critic <EOL> def test_process_cookbook_fail ( self ) : <EOL> self . tool = Foodcritic ( self . problems , None , self . fixtures [ <NUM_LIT:1> ] ) <EOL> self . tool . process_files ( None ) <EOL> problems = self . problems . all ( ) <EOL> eq_ ( <NUM_LIT:5> , len ( problems ) ) <EOL> expected = Comment ( <EOL> '<STR_LIT>' , <NUM_LIT:1> , <NUM_LIT:1> , <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> eq_ ( expected , problems [ <NUM_LIT:1> ] ) </s>
