#NEWLINE# def test_component_iam_role( monkeypatch ) : #NEWLINE# #INDENT# configuration = { #NEWLINE# #INDENT# 'Name' : 'MyRole' , #NEWLINE# 'MergePoliciesFromIamRoles' : [ 'OtherRole' ] , #NEWLINE# #UNINDENT# } #NEWLINE# definition = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# args = MagicMock ( ) #NEWLINE# args . region = 'foo' #NEWLINE# monkeypatch . setattr ( 'senza.components.iam_role.get_merged_policies' , MagicMock ( return_value = [ { #NEWLINE# #INDENT# 'a' : 'b' , #NEWLINE# #UNINDENT# } ] ) ) #NEWLINE# result = component_iam_role ( definition , args , args , MagicMock ( ) , False , MagicMock ( ) ) #NEWLINE# assert ( [ { #NEWLINE# #INDENT# 'a' : 'b' , #NEWLINE# #UNINDENT# } ] == result [ 'Resources' ] [ 'MyRole' ] [ 'Properties' ] [ 'Policies' ] )