Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
deepdraw
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
medai
software
deepdraw
Commits
71616fe3
Commit
71616fe3
authored
4 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[tests] Move CLI test units from conda/meta.yaml to nose
parent
a13b1a9f
No related branches found
No related tags found
1 merge request
!12
Streamlining
Pipeline
#38903
passed
4 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/ip/binseg/test/test_cli.py
+144
-0
144 additions, 0 deletions
bob/ip/binseg/test/test_cli.py
conda/meta.yaml
+0
-20
0 additions, 20 deletions
conda/meta.yaml
with
144 additions
and
20 deletions
bob/ip/binseg/test/test_cli.py
0 → 100644
+
144
−
0
View file @
71616fe3
#!/usr/bin/env python
# coding=utf-8
"""
Tests for our CLI applications
"""
from
click.testing
import
CliRunner
def
_check_help
(
entry_point
):
runner
=
CliRunner
()
result
=
runner
.
invoke
(
entry_point
,
[
"
--help
"
])
assert
result
.
exit_code
==
0
assert
result
.
output
.
startswith
(
"
Usage:
"
)
def
test_main_help
():
from
..script.binseg
import
binseg
_check_help
(
binseg
)
def
test_train_help
():
from
..script.train
import
train
_check_help
(
train
)
def
test_predict_help
():
from
..script.predict
import
predict
_check_help
(
predict
)
def
test_evaluate_help
():
from
..script.evaluate
import
evaluate
_check_help
(
evaluate
)
def
test_compare_help
():
from
..script.compare
import
compare
_check_help
(
compare
)
def
test_config_help
():
from
..script.config
import
config
_check_help
(
config
)
def
test_config_list_help
():
from
..script.config
import
list
_check_help
(
list
)
def
test_config_list
():
from
..script.config
import
list
runner
=
CliRunner
()
result
=
runner
.
invoke
(
list
)
assert
result
.
exit_code
==
0
assert
"
module: bob.ip.binseg.configs.datasets
"
in
result
.
output
assert
"
module: bob.ip.binseg.configs.models
"
in
result
.
output
def
test_config_list_v
():
from
..script.config
import
list
runner
=
CliRunner
()
result
=
runner
.
invoke
(
list
,
[
"
--verbose
"
])
assert
result
.
exit_code
==
0
assert
"
module: bob.ip.binseg.configs.datasets
"
in
result
.
output
assert
"
module: bob.ip.binseg.configs.models
"
in
result
.
output
def
test_config_describe_help
():
from
..script.config
import
describe
_check_help
(
describe
)
def
test_config_describe_drive
():
from
..script.config
import
describe
runner
=
CliRunner
()
result
=
runner
.
invoke
(
describe
,
[
"
drive
"
])
assert
result
.
exit_code
==
0
assert
"
[DRIVE-2004]
"
in
result
.
output
def
test_config_copy_help
():
from
..script.config
import
copy
_check_help
(
copy
)
def
test_config_copy
():
from
..script.config
import
copy
runner
=
CliRunner
()
with
runner
.
isolated_filesystem
():
result
=
runner
.
invoke
(
copy
,
[
"
drive
"
,
"
test.py
"
])
assert
result
.
exit_code
==
0
with
open
(
"
test.py
"
)
as
f
:
data
=
f
.
read
()
assert
"
[DRIVE-2004]
"
in
data
def
test_dataset_help
():
from
..script.dataset
import
dataset
_check_help
(
dataset
)
def
test_dataset_list_help
():
from
..script.dataset
import
list
_check_help
(
list
)
def
test_dataset_list
():
from
..script.dataset
import
list
runner
=
CliRunner
()
result
=
runner
.
invoke
(
list
)
assert
result
.
exit_code
==
0
assert
result
.
output
.
startswith
(
"
Supported datasets:
"
)
def
test_dataset_check_help
():
from
..script.dataset
import
check
_check_help
(
check
)
def
test_dataset_check
():
from
..script.dataset
import
check
runner
=
CliRunner
()
result
=
runner
.
invoke
(
check
,
[
"
--verbose
"
,
"
--verbose
"
])
assert
result
.
exit_code
==
0
This diff is collapsed.
Click to expand it.
conda/meta.yaml
+
0
−
20
View file @
71616fe3
...
...
@@ -47,26 +47,6 @@ test:
imports
:
-
{{
name
}}
commands
:
# test commands ("script" entry-points) from your package here
-
bob binseg --help
-
bob binseg config --help
-
bob binseg config list --help
-
bob binseg config list
-
bob binseg config list -v
-
bob binseg config describe --help
-
bob binseg config describe drive
-
bob binseg config describe drive -v
-
bob binseg config copy --help
-
bob binseg config copy drive /tmp/test.py
-
bob binseg dataset --help
-
bob binseg dataset list --help
-
bob binseg dataset list
-
bob binseg dataset check --help
-
bob binseg dataset check
-
bob binseg train --help
-
bob binseg predict --help
-
bob binseg evaluate --help
-
bob binseg compare --help
-
nosetests --with-coverage --cover-package={{ name }} -sv {{ name }}
-
sphinx-build -aEW {{ project_dir }}/doc {{ project_dir }}/sphinx
-
sphinx-build -aEb doctest {{ project_dir }}/doc sphinx
...
...
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