[PR #5647/be22ca06 backport][stable-6] cmd_runner: allow bool format to pass alternate (false) value (#5650)

cmd_runner: allow bool format to pass alternate (false) value (#5647)

* allow bool format to pass alternate (false) value

* add changelog fragment

(cherry picked from commit be22ca0633)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2022-12-04 12:39:30 +01:00 committed by GitHub
parent 2d616bf4d1
commit cc28cde3a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View file

@ -18,6 +18,10 @@ TC_FORMATS = dict(
simple_boolean__true=(fmt.as_bool, ("--superflag",), True, ["--superflag"]),
simple_boolean__false=(fmt.as_bool, ("--superflag",), False, []),
simple_boolean__none=(fmt.as_bool, ("--superflag",), None, []),
simple_boolean_both__true=(fmt.as_bool, ("--superflag", "--falseflag"), True, ["--superflag"]),
simple_boolean_both__false=(fmt.as_bool, ("--superflag", "--falseflag"), False, ["--falseflag"]),
simple_boolean_both__none=(fmt.as_bool, ("--superflag", "--falseflag"), None, ["--falseflag"]),
simple_boolean_both__none_ig=(fmt.as_bool, ("--superflag", "--falseflag", True), None, []),
simple_boolean_not__true=(fmt.as_bool_not, ("--superflag",), True, []),
simple_boolean_not__false=(fmt.as_bool_not, ("--superflag",), False, ["--superflag"]),
simple_boolean_not__none=(fmt.as_bool_not, ("--superflag",), None, ["--superflag"]),