Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.extension
Commits
aeba4e05
Commit
aeba4e05
authored
2 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests modifying the code's bobrc file
parent
cf350798
No related branches found
No related tags found
1 merge request
!145
Improves the search_file function
Pipeline
#62253
passed
2 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/extension/rc_config.py
+1
-0
1 addition, 0 deletions
bob/extension/rc_config.py
bob/extension/test_rc.py
+14
-4
14 additions, 4 deletions
bob/extension/test_rc.py
with
15 additions
and
4 deletions
bob/extension/rc_config.py
+
1
−
0
View file @
aeba4e05
...
@@ -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
"
)
This diff is collapsed.
Click to expand it.
bob/extension/test_rc.py
+
14
−
4
View file @
aeba4e05
...
@@ -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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment