ALLOW_AUTO_ARCHITECTURE_RUN flag for unsafe commands

This commit is contained in:
Evgenii Alekseev 2022-03-19 03:08:45 +03:00
parent 93406483fe
commit 060c7412b1
2 changed files with 9 additions and 0 deletions

View File

@ -31,6 +31,8 @@ class UnsafeCommands(Handler):
unsafe command help parser unsafe command help parser
""" """
ALLOW_AUTO_ARCHITECTURE_RUN = False # it should be called only as "no-architecture"
@classmethod @classmethod
def run(cls: Type[Handler], args: argparse.Namespace, architecture: str, def run(cls: Type[Handler], args: argparse.Namespace, architecture: str,
configuration: Configuration, no_report: bool, unsafe: bool) -> None: configuration: Configuration, no_report: bool, unsafe: bool) -> None:

View File

@ -31,3 +31,10 @@ def test_get_unsafe_commands() -> None:
commands = UnsafeCommands.get_unsafe_commands(parser) commands = UnsafeCommands.get_unsafe_commands(parser)
for command in commands: for command in commands:
assert subparser.choices[command].get_default("unsafe") assert subparser.choices[command].get_default("unsafe")
def test_disallow_auto_architecture_run() -> None:
"""
must not allow multi architecture run
"""
assert not UnsafeCommands.ALLOW_AUTO_ARCHITECTURE_RUN