Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
BioHPC
clair-singularity
Commits
e922c53c
Commit
e922c53c
authored
Aug 24, 2017
by
David Trudgian
Browse files
Bind to main IP for http server in tests
parent
235165fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_cli.py
View file @
e922c53c
import
pytest
import
json
import
s
ys
import
s
ocket
from
click.testing
import
CliRunner
from
clair_singularity.cli
import
cli
from
.test_image
import
testimage
MY_IP
=
socket
.
gethostbyname
(
socket
.
gethostname
())
@
pytest
.
fixture
def
runner
():
return
CliRunner
()
...
...
@@ -19,7 +22,7 @@ def test_help(runner):
def
test_full_json
(
runner
,
testimage
):
result
=
runner
.
invoke
(
cli
,
[
'--quiet'
,
'--json-output'
,
'--bind-ip'
,
'127.0.0.1'
,
'--bind-port'
,
'8081'
,
'--clair-uri'
,
[
'--quiet'
,
'--json-output'
,
'--bind-ip'
,
MY_IP
,
'--bind-port'
,
'8081'
,
'--clair-uri'
,
'http://127.0.0.1:6060'
,
testimage
])
output
=
json
.
loads
(
result
.
output
)
...
...
@@ -36,7 +39,7 @@ def test_full_json(runner, testimage):
def
test_full_text
(
runner
,
testimage
):
result
=
runner
.
invoke
(
cli
,
[
'--quiet'
,
'--bind-ip'
,
'127.0.0.1'
,
'--bind-port'
,
'8082'
,
'--clair-uri'
,
result
=
runner
.
invoke
(
cli
,
[
'--quiet'
,
'--bind-ip'
,
MY_IP
,
'--bind-port'
,
'8082'
,
'--clair-uri'
,
'http://127.0.0.1:6060'
,
testimage
])
# Check we do have some CVEs we expect reported here
assert
'bash - 4.3-14ubuntu1.1'
in
result
.
output
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment