Skip to content

Commit

Permalink
Updated TestJavaMoveDependenciesAction to Include lib Folder (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
CoshUS authored Dec 7, 2021
1 parent c03a233 commit 7843ac1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion aws_lambda_builders/workflows/java/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def _move_dependencies(self):
Move the entire lib directory from artifact folder to dependencies folder
"""
try:
dependencies_lib_dir = os.path.join(self.dependencies_dir, "lib")
lib_folder = os.path.join(self.artifacts_dir, "lib")
self.os_utils.move(lib_folder, self.dependencies_dir)
self.os_utils.move(lib_folder, dependencies_lib_dir)
except Exception as ex:
raise ActionFailedError(str(ex))
4 changes: 3 additions & 1 deletion tests/unit/workflows/java/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def test_copies_artifacts(self):
action = JavaMoveDependenciesAction(self.artifacts_dir, self.dependencies_dir, self.os_utils)
action.execute()

self.os_utils.move.assert_called_with(os.path.join(self.artifacts_dir, "lib"), self.dependencies_dir)
self.os_utils.move.assert_called_with(
os.path.join(self.artifacts_dir, "lib"), os.path.join(self.dependencies_dir, "lib")
)

def test_error_in_artifact_copy_raises_action_error(self):
self.os_utils.move.side_effect = Exception("scandir failed!")
Expand Down

0 comments on commit 7843ac1

Please sign in to comment.