<s> from mock import patch <EOL> from nose . tools import eq_ <EOL> from helper import TestCase <EOL> import appvalidator . submain as submain <EOL> class TestSubmainPackage ( TestCase ) : <EOL> @ patch ( "<STR_LIT>" , <EOL> lambda x , z : "<STR_LIT:success>" ) <EOL> def test_package_pass ( self ) : <EOL> "<STR_LIT>" <EOL> self . setup_err ( ) <EOL> name = "<STR_LIT>" <EOL> with open ( name ) as pack : <EOL> result = submain . test_package ( self . err , pack , name ) <EOL> self . assert_silent ( ) <EOL> eq_ ( result , "<STR_LIT:success>" ) <EOL> @ patch ( "<STR_LIT>" , <EOL> lambda x , z : "<STR_LIT:success>" ) <EOL> def test_package_corrupt ( self ) : <EOL> "<STR_LIT>" <EOL> self . setup_err ( ) <EOL> name = "<STR_LIT>" <EOL> with open ( name ) as pack : <EOL> result = submain . test_package ( self . err , pack , name ) <EOL> assert self . err . errors </s>
