Create tests and steps for temporary filename suffix

This commit is contained in:
karimpwnz 2021-01-02 20:54:26 +02:00
parent 31ada29a37
commit 4bbd2fe53b
4 changed files with 37 additions and 0 deletions

View file

@ -248,6 +248,15 @@ def contains_editor_file(context, method, text=""):
assert False, f"Method '{method}' not supported"
@then('the temporary filename suffix should be "{suffix}"')
def extension_editor_file(context, suffix):
filename = Path(context.editor_file["name"]).name
delimiter = "-" if "-" in filename else "."
file_suffix = delimiter + filename.split(delimiter)[-1]
print(file_suffix, suffix)
assert file_suffix == suffix
def _mock_getpass(inputs):
def prompt_return(prompt=""):
if type(inputs) == str: