@@ -71,7 +71,7 @@ def test_add_new_relic(aws_credentials, mock_function_config):
7171 is True
7272 )
7373
74- config = mock_function_config ("python3.6 " )
74+ config = mock_function_config ("python3.7 " )
7575 config ["Configuration" ]["Layers" ] = [{"Arn" : get_arn_prefix ("us-east-1" )}]
7676 assert (
7777 _add_new_relic (
@@ -90,7 +90,7 @@ def test_add_new_relic(aws_credentials, mock_function_config):
9090
9191 with patch ("newrelic_lambda_cli.layers.index" ) as mock_index :
9292 mock_index .return_value = []
93- config = mock_function_config ("python3.6 " )
93+ config = mock_function_config ("python3.7 " )
9494 assert (
9595 _add_new_relic (
9696 layer_install (
@@ -120,7 +120,7 @@ def test_add_new_relic(aws_credentials, mock_function_config):
120120 }
121121 },
122122 ]
123- config = mock_function_config ("python3.6 " )
123+ config = mock_function_config ("python3.7 " )
124124 with pytest .raises (UsageError ):
125125 _add_new_relic (
126126 layer_install (
@@ -134,7 +134,7 @@ def test_add_new_relic(aws_credentials, mock_function_config):
134134 nr_license_key = None ,
135135 )
136136
137- config = mock_function_config ("python3.6 " )
137+ config = mock_function_config ("python3.7 " )
138138 _add_new_relic (
139139 layer_install (
140140 session = session ,
@@ -152,7 +152,7 @@ def test_add_new_relic(aws_credentials, mock_function_config):
152152 in config ["Configuration" ]["Environment" ]["Variables" ]
153153 )
154154
155- config = mock_function_config ("python3.6 " )
155+ config = mock_function_config ("python3.7 " )
156156 config ["Configuration" ]["Environment" ]["Variables" ]["NEW_RELIC_FOO" ] = "bar"
157157 config ["Configuration" ]["Layers" ] = [{"Arn" : get_arn_prefix ("us-east-1" )}]
158158 update_kwargs = _add_new_relic (
@@ -170,6 +170,24 @@ def test_add_new_relic(aws_credentials, mock_function_config):
170170 assert "NEW_RELIC_FOO" in update_kwargs ["Environment" ]["Variables" ]
171171 assert update_kwargs ["Layers" ][0 ] != get_arn_prefix ("us-east-1" )
172172
173+ config = mock_function_config ("python3.6" )
174+ update_kwargs = _add_new_relic (
175+ layer_install (
176+ session = session ,
177+ aws_region = "us-east-1" ,
178+ nr_account_id = 12345 ,
179+ enable_extension = True ,
180+ enable_extension_function_logs = True ,
181+ upgrade = True ,
182+ ),
183+ config ,
184+ "foobarbaz" ,
185+ )
186+ assert (
187+ update_kwargs ["Environment" ]["Variables" ]["NEW_RELIC_LAMBDA_EXTENSION_ENABLED" ]
188+ == "false"
189+ )
190+
173191
174192@mock_lambda
175193def test_remove_new_relic (aws_credentials , mock_function_config ):
@@ -205,7 +223,7 @@ def test_remove_new_relic(aws_credentials, mock_function_config):
205223 is True
206224 )
207225
208- config = mock_function_config ("python3.6 " )
226+ config = mock_function_config ("python3.7 " )
209227 config ["Configuration" ]["Handler" ] = "what is this?"
210228 assert (
211229 _remove_new_relic (
@@ -262,7 +280,7 @@ def test_install(aws_credentials, mock_function_config):
262280 assert install (layer_install (session = mock_session ), "foobarbaz" ) is True
263281
264282 mock_client .get_function .reset_mock (return_value = True )
265- config = mock_function_config ("python3.6 " )
283+ config = mock_function_config ("python3.7 " )
266284 mock_client .get_function .return_value = config
267285 assert (
268286 install (
@@ -304,7 +322,7 @@ def test_uninstall(aws_credentials, mock_function_config):
304322 assert uninstall (layer_uninstall (session = mock_session ), "foobarbaz" ) is True
305323
306324 mock_client .get_function .reset_mock (return_value = True )
307- config = mock_function_config ("python3.6 " )
325+ config = mock_function_config ("python3.7 " )
308326 mock_client .get_function .return_value = config
309327 assert uninstall (layer_uninstall (session = mock_session ), "foobarbaz" ) is False
310328
0 commit comments