#NEWLINE# @ requires_network ( ) #NEWLINE# @ destructiveTest #NEWLINE# def test_refresh_db( self ) : #NEWLINE# #INDENT# '\n        test refreshing the package database\n        ' #NEWLINE# func = 'pkg.refresh_db' #NEWLINE# os_family = self . run_function ( 'grains.item' , [ 'os_family' ] ) [ 'os_family' ] #NEWLINE# if ( os_family == 'RedHat' ) : #NEWLINE# #INDENT# ret = self . run_function ( func ) #NEWLINE# self . assertIn ( ret , ( True , None ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( os_family == 'Debian' ) : #NEWLINE# #INDENT# ret = self . run_function ( func ) #NEWLINE# self . assertNotEqual ( ret , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( not isinstance ( ret , dict ) ) : #NEWLINE# #INDENT# self . skipTest ( 'Upstream repo did not return coherent results. Skipping test.' ) #NEWLINE# #UNINDENT# for ( source , state ) in ret . items ( ) : #NEWLINE# #INDENT# self . assertIn ( state , ( True , False , None ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# os_grain = self . run_function ( 'grains.item' , [ 'os' ] ) [ 'os' ] #NEWLINE# self . skipTest ( '{0} is unavailable on {1}' . format ( func , os_grain ) )