<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> from salttesting import skipIf <EOL> from salttesting . helpers import ( <EOL> destructiveTest , <EOL> ensure_in_syspath , <EOL> requires_system_grains <EOL> ) <EOL> ensure_in_syspath ( '<STR_LIT>' ) <EOL> import integration <EOL> import salt . utils <EOL> import salt . ext . six as six <EOL> class PkgrepoTest ( integration . ModuleCase , <EOL> integration . SaltReturnAssertsMixIn ) : <EOL> '''<STR_LIT>''' <EOL> @ destructiveTest <EOL> @ skipIf ( salt . utils . is_windows ( ) , '<STR_LIT>' ) <EOL> @ requires_system_grains <EOL> def test_pkgrepo_01_managed ( self , grains ) : <EOL> '''<STR_LIT>''' <EOL> os_grain = self . run_function ( '<STR_LIT>' , [ '<STR_LIT>' ] ) [ '<STR_LIT>' ] <EOL> os_release_info = tuple ( self . run_function ( '<STR_LIT>' , [ '<STR_LIT>' ] ) [ '<STR_LIT>' ] ) <EOL> if os_grain == '<STR_LIT>' and os_release_info >= ( <NUM_LIT:15> , <NUM_LIT:10> ) : <EOL> self . skipTest ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> if grains [ '<STR_LIT>' ] == '<STR_LIT>' : <EOL> try : <EOL> from aptsources import sourceslist <EOL> except ImportError : <EOL> self . skipTest ( <EOL> '<STR_LIT>' <EOL> ) <EOL> ret = self . run_function ( '<STR_LIT>' , mods = '<STR_LIT>' , timeout = <NUM_LIT> ) <EOL> self . assertReturnNonEmptySaltType ( ret ) <EOL> for state_id , state_result in six . iteritems ( ret ) : <EOL> self . assertSaltTrueReturn ( dict ( [ ( state_id , state_result ) ] ) ) <EOL> @ destructiveTest <EOL> @ skipIf ( salt . utils . is_windows ( ) , '<STR_LIT>' ) <EOL> def test_pkgrepo_02_absent ( self ) : <EOL> '''<STR_LIT>''' <EOL> os_grain = self . run_function ( '<STR_LIT>' , [ '<STR_LIT>' ] ) [ '<STR_LIT>' ] <EOL> os_release_info = tuple ( self . run_function ( '<STR_LIT>' , [ '<STR_LIT>' ] ) [ '<STR_LIT>' ] ) <EOL> if os_grain == '<STR_LIT>' and os_release_info >= ( <NUM_LIT:15> , <NUM_LIT:10> ) : <EOL> self . skipTest ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> ret = self . run_function ( '<STR_LIT>' , mods = '<STR_LIT>' , timeout = <NUM_LIT> ) <EOL> self . assertReturnNonEmptySaltType ( ret ) <EOL> for state_id , state_result in six . iteritems ( ret ) : <EOL> self . assertSaltTrueReturn ( dict ( [ ( state_id , state_result ) ] ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from integration import run_tests <EOL> run_tests ( PkgrepoTest ) </s>
