Last active
August 25, 2017 01:46
-
-
Save btamayo/f66a5c1723b8288abbe5fe42bdfc0656 to your computer and use it in GitHub Desktop.
Format string problem
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
# Template | |
TEST_TEMPLATE_RAW = """@test "{description} [{shell}]" {{ | |
run ./{script_name} {shell} --debug --no-exec | |
{assert_type} {partial} {regexflag} "{expected}" | |
}} | |
# Codebit | |
# test is dumped in by pyyaml | |
print TEST_TEMPLATE_RAW.format(**test) |
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
# Output | |
@test "Unknown command check 1.0 [bianca-blog.dev.app site.yml -b example-1 check list-hosts]" { | |
run ./ap.sh bianca-blog.dev.app site.yml -b example-1 check list-hosts --debug --no-exec | |
assert_failure "" | |
} | |
# Desired output (note the trimmed whitespace after assert_failure/getting rid of "" | |
@test "Unknown command check 1.0 [bianca-blog.dev.app site.yml -b example-1 check list-hosts]" { | |
run ./ap.sh bianca-blog.dev.app site.yml -b example-1 check list-hosts --debug --no-exec | |
assert_failure | |
} |
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
# Test keys/vals (in yaml) | |
description: Unknown command check | |
playbook: site.yml | |
commands: -b example-1 check list-hosts | |
assert_type: assert_failure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment