Skip to content
Snippets Groups Projects
Commit aeba4e05 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Fix tests modifying the code's bobrc file

parent cf350798
No related branches found
No related tags found
1 merge request!145Improves the search_file function
Pipeline #62253 passed
...@@ -97,3 +97,4 @@ def _saverc(context): ...@@ -97,3 +97,4 @@ def _saverc(context):
path = _get_rc_path() path = _get_rc_path()
with open(path, "wt") as f: with open(path, "wt") as f:
f.write(_rc_to_str(context)) f.write(_rc_to_str(context))
f.write("\n")
...@@ -74,8 +74,14 @@ def test_bob_config(): ...@@ -74,8 +74,14 @@ def test_bob_config():
assert expected_output == result.output, result.output assert expected_output == result.output, result.output
# test config unset (with starting substring) # test config unset (with starting substring)
result = runner.invoke(main_cli, ["config", "unset", "bob.db.atnt"]) result = runner.invoke(
result = runner.invoke(main_cli, ["config", "get", "bob.db.atnt"]) main_cli,
["config", "unset", "bob.db.atnt"],
env={ENVNAME: bobrcfile},
)
result = runner.invoke(
main_cli, ["config", "get", "bob.db.atnt"], env={ENVNAME: bobrcfile}
)
assert_click_runner_result(result, 1) assert_click_runner_result(result, 1)
# test config unset (with substring contained) # test config unset (with substring contained)
...@@ -91,7 +97,11 @@ def test_bob_config(): ...@@ -91,7 +97,11 @@ def test_bob_config():
env={ENVNAME: bobrcfile}, env={ENVNAME: bobrcfile},
) )
result = runner.invoke( result = runner.invoke(
main_cli, ["config", "unset", "--contain", "atnt"] main_cli,
["config", "unset", "--contain", "atnt"],
env={ENVNAME: bobrcfile},
)
result = runner.invoke(
main_cli, ["config", "get", "bob.db.atnt"], env={ENVNAME: bobrcfile}
) )
result = runner.invoke(main_cli, ["config", "get", "bob.db.atnt"])
assert_click_runner_result(result, 1) assert_click_runner_result(result, 1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment