Kaydet (Commit) d5bcdaf2 authored tarafından Aanand Prasad's avatar Aanand Prasad

Use pytest helpers to assert exceptions and deprecated warnings

Signed-off-by: 's avatarAanand Prasad <aanand.prasad@gmail.com>
üst 6e27c2a3
This diff is collapsed.
......@@ -14,6 +14,8 @@ from docker.auth import resolve_repository_name, resolve_authconfig
from . import base
import pytest
class UtilsTest(base.BaseTestCase):
longMessage = True
......@@ -79,13 +81,8 @@ class UtilsTest(base.BaseTestCase):
}
for host in invalid_hosts:
try:
parsed = parse_host(host)
self.fail('Expected to fail but success: %s -> %s' % (
host, parsed
))
except DockerException:
pass
with pytest.raises(DockerException):
parse_host(host)
for host, expected in valid_hosts.items():
self.assertEqual(parse_host(host), expected, msg=host)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment