-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
70 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
EXAMPLE_CONFIG = """ | ||
[tool.poe.env] | ||
GLOBAL_POE_ROOT = "${POE_ROOT}" | ||
GLOBAL_POE_PWD = "${POE_PWD}" | ||
[tool.poe.tasks.my-task] | ||
default_item_type = "cmd" | ||
sequence = [ | ||
"echo POE_ROOT: ${POE_ROOT}", | ||
"echo GLOBAL_POE_ROOT: ${GLOBAL_POE_ROOT}", | ||
"echo TASK_POE_ROOT: ${TASK_POE_ROOT}", | ||
"echo POE_PWD: ${POE_PWD}", | ||
"echo GLOBAL_POE_PWD: ${GLOBAL_POE_PWD}", | ||
"echo TASK_POE_PWD: ${TASK_POE_PWD}", | ||
] | ||
[tool.poe.tasks.my-task.env] | ||
TASK_POE_ROOT = "${POE_ROOT}" | ||
TASK_POE_PWD = "${POE_PWD}" | ||
""" | ||
|
||
|
||
def test_global_env_templating(temp_pyproject, run_poe_subproc): | ||
project_path = temp_pyproject(EXAMPLE_CONFIG) | ||
result = run_poe_subproc("my-task", cwd=project_path) | ||
assert result.code == 0 | ||
|
||
printed_vars = { | ||
line.split(": ")[0]: line.split(": ")[1] | ||
for line in result.stdout.split("\n") | ||
if ": " in line | ||
} | ||
for value in printed_vars.values(): | ||
assert value.endswith(str(project_path)[5:] + "'") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.