def test_setup_script_interpolates_module(simple_resource): framework = Namespace(module="my_module", setup_script="{module}/t.sh") _add_default_setup_script(framework, simple_resource) assert framework.setup_script == "my_module/t.sh"
def test_setup_script_set_to_none_if_undefined(simple_resource): framework = Namespace() _add_default_setup_script(framework, simple_resource) assert framework.setup_script is None
def test_setup_script_kept_if_defined(simple_resource): framework = Namespace(module="my_module", setup_script="t.sh") _add_default_setup_script(framework, simple_resource) assert framework.setup_script == "t.sh"
def test_setup_script_interpolates_directory(simple_resource, alias, actual): framework = Namespace(setup_script=f"{{{alias}}}/t.sh", module="") _add_default_setup_script(framework, simple_resource) assert framework.setup_script.endswith(f"{actual}/t.sh")