def test_must_return_lambci_image(self): expected = "lambci/lambda:foo" image_builder = Mock() image_builder.build.return_value = expected self.assertEquals(LambdaContainer._get_image(image_builder, 'foo', []), expected)
def test_must_return_lambci_image_without_debug(self): debug_options = DebugContext() expected = "lambci/lambda:foo" image_builder = Mock() image_builder.build.return_value = expected self.assertEqual(LambdaContainer._get_image(image_builder, "foo", [], debug_options), expected) image_builder.build.assert_called_with("foo", [], False)
def test_must_return_lambci_image_with_debug(self): debug_options = DebugContext(debug_ports=[1235], debugger_path="a", debug_args="a=b c=d e=f") expected = "lambci/lambda:foo" image_builder = Mock() image_builder.build.return_value = expected self.assertEqual(LambdaContainer._get_image(image_builder, "foo", [], debug_options), expected) image_builder.build.assert_called_with("foo", [], True)
def test_must_return_build_image(self): expected = "amazon/aws-sam-cli-emulation-image-foo:rapid-x.y.z" image_builder = Mock() image_builder.build.return_value = expected self.assertEqual( LambdaContainer._get_image( lambda_image=image_builder, runtime="foo", packagetype=ZIP, image=None, layers=[], ), expected, ) image_builder.build.assert_called_with("foo", ZIP, None, [])
def test_must_return_lambci_image_without_debug(self): debug_options = DebugContext() expected = "lambci/lambda:foo" image_builder = Mock() image_builder.build.return_value = expected self.assertEqual( LambdaContainer._get_image( lambda_image=image_builder, runtime="foo", packagetype=ZIP, image=None, layers=[], debug_options=debug_options, ), expected, ) image_builder.build.assert_called_with("foo", ZIP, None, [], False)
def test_must_return_lambci_image_with_debug(self): debug_options = DebugContext(debug_ports=[1235], debugger_path="a", debug_args="a=b c=d e=f") expected = "lambci/lambda:foo" image_builder = Mock() image_builder.build.return_value = expected self.assertEqual( LambdaContainer._get_image( lambda_image=image_builder, runtime="foo", packagetype=ZIP, image=None, layers=[], debug_options=debug_options, ), expected, ) image_builder.build.assert_called_with("foo", ZIP, None, [], True)
def test_must_return_lambci_image(self): runtime = "foo" expected = "lambci/lambda:foo" self.assertEquals(LambdaContainer._get_image(runtime), expected)