def test_must_skip_unknown_paths(self): input = ["/known/path", "/unknown/path"] mapping = {"/known/path": "/first"} expected = ["/first", "/unknown/path"] result = LambdaBuildContainer._convert_to_container_dirs(input, mapping) self.assertEqual(result, expected)
def test_must_skip_on_empty_input(self): input = None mapping = {"/known/path": "/first"} expected = None result = LambdaBuildContainer._convert_to_container_dirs(input, mapping) self.assertEqual(result, expected)
def test_must_work_on_abs_and_relative_paths(self): input = [".", "../foo", "/some/abs/path"] mapping = {str(pathlib.Path(".").resolve()): "/first", "../foo": "/second", "/some/abs/path": "/third"} expected = ["/first", "/second", "/third"] result = LambdaBuildContainer._convert_to_container_dirs(input, mapping) self.assertEqual(result, expected)