Skip to content

Commit

Permalink
fmt w/ black
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Sep 11, 2024
1 parent 214b91c commit 28a1360
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion contrib/runners/orquesta_runner/tests/unit/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ python_tests(
"test_policies.py": dict(
dependencies=["st2actions/st2actions/policies/retry.py"]
)
}
},
)

python_test_utils(
Expand Down
14 changes: 9 additions & 5 deletions contrib/runners/python_runner/tests/unit/test_pythonrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@


# Use DUMMY_PACK_1 instead of depending on everything in the core (SYSTEM_PACK_NAME) pack.
@mock.patch("st2common.util.sandboxing.SYSTEM_PACK_NAMES", [DUMMY_PACK_1, *SYSTEM_PACK_NAMES])
@mock.patch(
"st2common.util.sandboxing.SYSTEM_PACK_NAMES", [DUMMY_PACK_1, *SYSTEM_PACK_NAMES]
)
@mock.patch("python_runner.python_runner.sys", mock_sys)
class PythonRunnerTestCase(RunnerTestCase, CleanDbTestCase):
register_packs = True
Expand Down Expand Up @@ -996,7 +998,7 @@ def test_content_version_old_git_version(self, mock_run_command):
runner.runner_parameters = {"content_version": "v0.10.0"}

expected_msg = (
fr'Failed to create git worktree for pack "{DUMMY_PACK_1}": Installed git version '
rf'Failed to create git worktree for pack "{DUMMY_PACK_1}": Installed git version '
"doesn't support git worktree command. To be able to utilize this "
"functionality you need to use git >= 2.5.0."
)
Expand All @@ -1017,7 +1019,7 @@ def test_content_version_pack_repo_not_git_repository(self, mock_run_command):
runner.runner_parameters = {"content_version": "v0.10.0"}

expected_msg = (
fr'Failed to create git worktree for pack "{DUMMY_PACK_1}": Pack directory '
rf'Failed to create git worktree for pack "{DUMMY_PACK_1}": Pack directory '
'".*" is not a '
"git repository. To utilize this functionality, pack directory needs to "
"be a git repository."
Expand All @@ -1038,7 +1040,7 @@ def test_content_version_invalid_git_revision(self, mock_run_command):
runner.runner_parameters = {"content_version": "vinvalid"}

expected_msg = (
fr'Failed to create git worktree for pack "{DUMMY_PACK_1}": Invalid content_version '
rf'Failed to create git worktree for pack "{DUMMY_PACK_1}": Invalid content_version '
'"vinvalid" provided. Make sure that git repository is up '
"to date and contains that revision."
)
Expand All @@ -1054,7 +1056,9 @@ def test_missing_config_item_user_friendly_error(self):
self.assertIsNotNone(output)
self.assertIn("{}", output["stdout"])
self.assertIn("default_value", output["stdout"])
self.assertIn(f'Config for pack "{DUMMY_PACK_1}" is missing key "key"', output["stderr"])
self.assertIn(
f'Config for pack "{DUMMY_PACK_1}" is missing key "key"', output["stderr"]
)
self.assertIn(
'make sure you run "st2ctl reload --register-configs"', output["stderr"]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,6 @@ def test_inject_extra_sys_path_for_pack_tests(
target = rule_runner.get_target(address)
result = rule_runner.request(PytestPluginSetup, (PytestPackTestRequest(target),))
assert result.digest == EMPTY_DIGEST
assert result.extra_sys_path == expected # TODO: pants does not have this attribute yet.
assert (
result.extra_sys_path == expected
) # TODO: pants does not have this attribute yet.

0 comments on commit 28a1360

Please sign in to comment.