Skip to content

Commit

Permalink
Address windows backslash issue
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <[email protected]>
  • Loading branch information
s0undt3ch committed Jul 14, 2022
1 parent 05d20f6 commit ae245e5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/functional/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ def salt_factories_config():
pytester.makepyfile(
"""
def test_factories(salt_factories):
assert str(salt_factories.scripts_dir) == '{}'
assert str(salt_factories.scripts_dir) == r'{}'
def test_python_executable(salt_factories):
assert salt_factories.python_executable is None
def test_master(salt_factories):
factory = salt_factories.salt_master_daemon("foo-master")
assert str(factory.script_name) == '{}'
assert str(factory.script_name) == r'{}'
""".format(
scripts_dir,
scripts_dir / "salt-master",
Expand All @@ -120,7 +120,7 @@ def test_scripts_dir_config_fixture(pytester, scripts_dir):
@pytest.fixture(scope="session")
def salt_factories_config():
return {{
"scripts_dir": '{}',
"scripts_dir": r'{}',
"python_executable": '{}',
}}
""".format(
Expand All @@ -130,7 +130,7 @@ def salt_factories_config():
pytester.makepyfile(
"""
def test_factories(salt_factories):
assert str(salt_factories.scripts_dir) == '{}'
assert str(salt_factories.scripts_dir) == r'{}'
def test_python_executable(salt_factories):
assert salt_factories.python_executable is None
Expand Down Expand Up @@ -195,7 +195,7 @@ def test_system_service_config_fixture(pytester, system_service, tmp_path):
@pytest.fixture(scope="session")
def salt_factories_config():
return {{
"root_dir": '{}',
"root_dir": r'{}',
"system_service": {},
}}
""".format(
Expand All @@ -216,15 +216,15 @@ def test_root_dir(salt_factories):
if {system_service}:
assert str(salt_factories.root_dir) == '/'
else:
assert str(salt_factories.root_dir) == '{root_dir}'
assert str(salt_factories.root_dir) == r'{root_dir}'
def test_factories(salt_factories):
assert salt_factories.system_service is {system_service}
def test_master(salt_factories):
if {system_service}:
# We set root_dir here to allow tests to run without being root
salt_factories.root_dir = pathlib.Path('{root_dir}')
salt_factories.root_dir = pathlib.Path(r'{root_dir}')
factory = salt_factories.salt_master_daemon("foo-master")
assert factory.system_service is {system_service}
Expand Down

0 comments on commit ae245e5

Please sign in to comment.