#NEWLINE# def test_that_when_creating_a_function_with_zipfile_and_s3_raises_a_salt_invocation_error( self ) : #NEWLINE# #INDENT# '\n        tests Creating a function without code\n        ' #NEWLINE# with patch . dict ( boto_lambda . __salt__ , { #NEWLINE# #INDENT# 'boto_iam.get_account_id' : MagicMock ( return_value = '1234' ) , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# with self . assertRaisesRegexp ( SaltInvocationError , 'Either ZipFile must be specified, or S3Bucket and S3Key must be provided.' ) : #NEWLINE# #INDENT# with TempZipFile ( ) as zipfile : #NEWLINE# #INDENT# lambda_creation_result = boto_lambda . create_function ( FunctionName = 'testfunction' , Runtime = 'python2.7' , Role = 'myrole' , Handler = 'file.method' , ZipFile = zipfile , S3Bucket = 'bucket' , S3Key = 'key' , ** conn_parameters )