Skip to content

Commit

Permalink
Test deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Mar 2, 2023
1 parent 48daa2e commit 174aa5e
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion tests/test_job_environment_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def tearDown(self):

# -- TESTS ---------------------------------------------------------
@unittest.skipIf(opersys != "win32", "Test specific to Windows.")
def test_environment_variables_set(self):
def test_environment_variables_set_unset(self):
"""Test YAML loader"""
fake_env_vars = [
{
Expand Down Expand Up @@ -95,6 +95,29 @@ def test_environment_variables_set(self):
str(Path(expanduser("~/scripts/qgis_startup.py")).resolve()),
)

# clean up
fake_env_vars = [
{
"name": "QDT_TEST_FAKE_ENV_VAR_BOOL",
"scope": "user",
"action": "remove",
},
{
"name": "QDT_TEST_FAKE_ENV_VAR_PATH",
"scope": "user",
"action": "remove",
},
]
job_env_vars = JobEnvironmentVariables(fake_env_vars)
job_env_vars.run()

self.assertIsNone(
get_environment_variable("QDT_TEST_FAKE_ENV_VAR_BOOL", "user")
)
self.assertIsNone(
get_environment_variable("QDT_TEST_FAKE_ENV_VAR_PATH"),
)

def test_prepare_value(self):
"""Test prepare_value method"""
job_env_vars = JobEnvironmentVariables([])
Expand Down

0 comments on commit 174aa5e

Please sign in to comment.