Use explicit "given the config exists" for copying config files instead of shoehorning in "given we use the config" twice

This commit is contained in:
Micah Jerome Ellison 2021-10-23 13:47:34 -07:00
parent 31354ba669
commit 51e8606f44
2 changed files with 26 additions and 18 deletions

View file

@ -108,6 +108,14 @@ def we_use_the_config(config_file, temp_dir, working_dir):
return config_dest
@given(parse('the config "{config_file}" exists'), target_fixture="config_path")
@given('the config "<config_file>" exists', target_fixture="config_path")
def config_exists(config_file, temp_dir, working_dir):
config_source = os.path.join(working_dir, "data", "configs", config_file)
config_dest = os.path.join(temp_dir.name, config_file)
shutil.copy2(config_source, config_dest)
@given(parse('we use the password "{pw}" if prompted'), target_fixture="password")
def use_password_forever(pw):
return pw