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
235165fb
Commit
235165fb
authored
Aug 24, 2017
by
David Trudgian
Browse files
Fix ImageException test
parent
e8f940b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_image.py
View file @
235165fb
...
...
@@ -6,7 +6,7 @@ import time
import
pytest
import
requests
from
clair_singularity.image
import
image_to_tgz
,
check_image
,
http_server
from
clair_singularity.image
import
image_to_tgz
,
check_image
,
http_server
,
ImageException
from
clair_singularity.util
import
sha256
,
err_and_exit
,
wait_net_service
...
...
@@ -25,10 +25,9 @@ def test_check_image(testimage):
# Valid image return True
assert
check_image
(
testimage
)
# Sys exit for invalid image
with
pytest
.
raises
(
SystemExit
)
as
pytest_wrapped_e
:
with
pytest
.
raises
(
ImageException
)
as
pytest_wrapped_e
:
check_image
(
'i_do_not_exist.img'
)
assert
pytest_wrapped_e
.
type
==
SystemExit
assert
pytest_wrapped_e
.
value
.
code
==
66
assert
pytest_wrapped_e
.
type
==
ImageException
def
test_image_to_tgz
(
testimage
):
...
...
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