|
15 | 15 | import pytest
|
16 | 16 | import os
|
17 | 17 | import subprocess
|
18 |
| -from mock import patch |
| 18 | +from mock import patch, ANY |
19 | 19 |
|
20 | 20 | from sagemaker import git_utils
|
21 | 21 |
|
@@ -180,7 +180,7 @@ def test_git_clone_repo_dependencies_not_exist(exists, isdir, isfile, mkdtemp, c
|
180 | 180 | @patch("subprocess.check_call")
|
181 | 181 | @patch("tempfile.mkdtemp", return_value=REPO_DIR)
|
182 | 182 | @patch("os.path.isfile", return_value=True)
|
183 |
| -def test_git_clone_repo_with_username_password_no_2fa(sfile, mkdtemp, check_call): |
| 183 | +def test_git_clone_repo_with_username_password_no_2fa(isfile, mkdtemp, check_call): |
184 | 184 | git_config = {
|
185 | 185 | "repo": PRIVATE_GIT_REPO,
|
186 | 186 | "branch": PRIVATE_BRANCH,
|
@@ -262,12 +262,14 @@ def test_git_clone_repo_with_token_2fa(isfile, mkdtemp, check_call):
|
262 | 262 |
|
263 | 263 |
|
264 | 264 | @patch("subprocess.check_call")
|
| 265 | +@patch("os.chmod") |
265 | 266 | @patch("tempfile.mkdtemp", return_value=REPO_DIR)
|
266 | 267 | @patch("os.path.isfile", return_value=True)
|
267 |
| -def test_git_clone_repo_ssh(isfile, mkdtemp, check_call): |
| 268 | +def test_git_clone_repo_ssh(isfile, mkdtemp, chmod, check_call): |
268 | 269 | git_config = {"repo": PRIVATE_GIT_REPO_SSH, "branch": PRIVATE_BRANCH, "commit": PRIVATE_COMMIT}
|
269 | 270 | entry_point = "entry_point"
|
270 | 271 | ret = git_utils.git_clone_repo(git_config, entry_point)
|
| 272 | + chmod.assert_any_call(ANY, 0o511) |
271 | 273 | assert ret["entry_point"] == "/tmp/repo_dir/entry_point"
|
272 | 274 | assert ret["source_dir"] is None
|
273 | 275 | assert ret["dependencies"] is None
|
|
0 commit comments