#NEWLINE# def test_parse_operating_system_image_meta( self , mock_nailgun ) : #NEWLINE# #INDENT# d = { #NEWLINE# #INDENT# 'Centos' : objects . Centos , #NEWLINE# 'Ubuntu' : objects . Ubuntu , #NEWLINE# 'unknown' : None , #NEWLINE# #UNINDENT# } #NEWLINE# drv = nailgun . Nailgun ( 'fake_data' ) #NEWLINE# for ( os_name , obj ) in six . iteritems ( d ) : #NEWLINE# #INDENT# os = drv . get_os_by_image_meta ( { #NEWLINE# #INDENT# 'name' : os_name , #NEWLINE# 'minor' : 1 , #NEWLINE# 'major' : 2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# if os : #NEWLINE# #INDENT# self . assertIsInstance ( mock_nailgun , obj ) #NEWLINE# self . assertEqual ( 1 , os . minor ) #NEWLINE# self . assertEqual ( 2 , os . major ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertIsNone ( os ) #NEWLINE# self . assertEqual ( 'unknown' , os_name )