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
a934e17a
Commit
a934e17a
authored
6 years ago
by
Theophile GENTILHOMME
Browse files
Options
Downloads
Patches
Plain Diff
Add more constraining test
parent
0f565efd
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!86
Dump config file
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/extension/data/test_dump_config.py
+10
-0
10 additions, 0 deletions
bob/extension/data/test_dump_config.py
bob/extension/test_click_helper.py
+8
-3
8 additions, 3 deletions
bob/extension/test_click_helper.py
with
18 additions
and
3 deletions
bob/extension/data/test_dump_config.py
0 → 100644
+
10
−
0
View file @
a934e17a
## Configuration file automatically generated at 05/07/2018 for cli test.
## Path leading to test blablabla.
## Option: -t, --test [default: /my/path/test.txt]
# test = /my/path/test.txt
This diff is collapsed.
Click to expand it.
bob/extension/test_click_helper.py
+
8
−
3
View file @
a934e17a
import
click
import
pkg_resources
from
click.testing
import
CliRunner
from
bob.extension.scripts.click_helper
import
(
verbosity_option
,
bool_option
,
list_float_option
,
...
...
@@ -178,7 +179,7 @@ def test_config_dump():
def
cli
():
pass
@cli
ck
.command
(
cls
=
ConfigCommand
)
@cli.command
(
cls
=
ConfigCommand
)
@click.option
(
'
-t
'
,
'
--test
'
,
required
=
True
,
default
=
"
/my/path/test.txt
"
,
help
=
"
Path leading to test blablabla
"
,
cls
=
ResourceOption
)
@verbosity_option
()
...
...
@@ -186,5 +187,9 @@ def test_config_dump():
pass
runner
=
CliRunner
()
with
runner
.
isolated_filesystem
():
result
=
runner
.
invoke
(
cli
,
[
'
test
'
,
'
-dc
'
,
'
TEST_CONF
'
],
catch_exceptions
=
False
)
assert
result
.
exit_code
!=
0
,
(
result
.
exit_code
,
result
.
output
)
result
=
runner
.
invoke
(
cli
,
[
'
test
'
,
'
-H
'
,
'
TEST_CONF
'
],
catch_exceptions
=
False
)
ref
=
pkg_resources
.
resource_filename
(
'
bob.extension
'
,
'
data/test_dump_config.py
'
)
assert
result
.
exit_code
==
0
,
(
result
.
exit_code
,
result
.
output
)
with
open
(
'
TEST_CONF
'
,
'
r
'
)
as
f
,
open
(
ref
,
'
r
'
)
as
f2
:
assert
f
.
read
()
==
f2
.
read
()
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