def test_must_provide_entrypoint_for_certain_runtimes_only(self, runtime): if runtime in RUNTIMES_WITH_ENTRYPOINT: result = LambdaContainer._get_entry_point(runtime, self.debug_options) self.assertIsNotNone(result, "{} runtime must provide entrypoint".format(runtime)) else: with self.assertRaises(DebuggingNotSupported): LambdaContainer._get_entry_point(runtime, self.debug_options)
def test_must_provide_entrypoint_for_certain_runtimes_only(self, runtime): if runtime in RUNTIMES_WITH_ENTRYPOINT: result = LambdaContainer._get_entry_point(runtime, self.debug_options) self.assertIsNotNone(result, "{} runtime must provide entrypoint".format(runtime)) else: with self.assertRaises(DebuggingNotSupported): LambdaContainer._get_entry_point(runtime, self.debug_options)
def test_must_provide_entrypoint_for_certain_runtimes_only(self, runtime): result = LambdaContainer._get_entry_point(runtime, self.debug_options) if runtime in RUNTIMES_WITH_ENTRYPOINT: self.assertIsNotNone(result, "{} runtime must provide entrypoint".format(runtime)) else: self.assertIsNone(result, "{} runtime must NOT provide entrypoint".format(runtime))
def test_debug_arg_must_be_split_by_spaces_and_appended_to_entrypoint(self, runtime): """ Debug args list is appended starting at second position in the array """ expected_debug_args = ["a=b", "c=d", "e=f"] result = LambdaContainer._get_entry_point(runtime, self.debug_options) actual = result[1:4] self.assertEquals(actual, expected_debug_args)
def test_debug_arg_must_be_split_by_spaces_and_appended_to_bootstrap_based_entrypoint(self, runtime): """ Debug args list is appended as arguments to bootstrap-args, which is past the fourth position in the array """ expected_debug_args = ["a=b", "c=d", "e=f"] result = LambdaContainer._get_entry_point(runtime, self.debug_options) actual = result[4:5][0] self.assertTrue(all(debug_arg in actual for debug_arg in expected_debug_args))
def test_debug_arg_must_be_split_by_spaces_and_appended_to_entrypoint(self, runtime): """ Debug args list is appended starting at second position in the array """ expected_debug_args = ["a=b", "c=d", "e=f"] result = LambdaContainer._get_entry_point(runtime, self.debug_options) actual = result[1:4] self.assertEquals(actual, expected_debug_args)
def test_must_provide_entrypoint_even_without_debug_args(self, runtime): debug_options = DebugContext(debug_ports=[1235], debug_args=None) result = LambdaContainer._get_entry_point(runtime, debug_options) self.assertIsNotNone(result)
def test_must_skip_if_debug_port_is_not_specified(self): self.assertIsNone( LambdaContainer._get_entry_point("runtime", None), "Must not provide entrypoint if debug port is not given")
def test_must_provide_entrypoint_even_without_debug_args(self, runtime): debug_options = DebugContext(debug_port=1235, debug_args=None) result = LambdaContainer._get_entry_point(runtime, debug_options) self.assertIsNotNone(result)
def test_must_skip_if_debug_port_is_not_specified(self): self.assertIsNone(LambdaContainer._get_entry_point("runtime", None), "Must not provide entrypoint if debug port is not given")
def test_must_provide_entrypoint_even_without_debug_args(self, runtime): result = LambdaContainer._get_entry_point(runtime, self.debug_port) self.assertIsNotNone(result)