#NEWLINE# def _test_requires_secure_boot( self , flavor_secure_boot , image_prop_secure_boot , fake_vm_gen = constants . VM_GEN_2 ) : #NEWLINE# #INDENT# mock_instance = mock . MagicMock ( ) #NEWLINE# flavor_secure_boot = { #NEWLINE# #INDENT# 'extra_specs' : { #NEWLINE# #INDENT# 'os:secure_boot' : flavor_secure_boot , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# mock_image_meta = { #NEWLINE# #INDENT# 'properties' : { #NEWLINE# #INDENT# 'os_secure_boot' : image_prop_secure_boot , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# if ( flavor_secure_boot in ( 'required' , 'disabled' ) ) : #NEWLINE# #INDENT# expected_result = ( constants . REQUIRED == flavor_secure_boot ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# expected_result = ( image_prop_secure_boot == 'required' ) #NEWLINE# #UNINDENT# if ( ( fake_vm_gen != constants . VM_GEN_2 ) and expected_result ) : #NEWLINE# #INDENT# self . assertRaises ( os_win_exc . HyperVException , self . _vmops . _requires_secure_boot , mock_instance , mock_image_meta ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = self . _vmops . _requires_secure_boot ( mock_instance , mock_image_meta , fake_vm_gen ) #NEWLINE# self . assertEqual ( expected_result , result )