change pkg_resources for open __init__ in test too
This commit is contained in:
parent
ea6691247a
commit
7f9be17c92
|
@ -123,7 +123,8 @@ def test_get_version(app: Devicehub, client: Client):
|
||||||
"""Checks GETting versions of services."""
|
"""Checks GETting versions of services."""
|
||||||
|
|
||||||
content, res = client.get("/versions/", None)
|
content, res = client.get("/versions/", None)
|
||||||
dh_version = pkg_resources.require('ereuse-devicehub')[0].version
|
with open("ereuse_devicehub/__init__.py", encoding="utf8") as f:
|
||||||
|
dh_version = re.search(r'__version__ = "(.*?)"', f.read()).group(1)
|
||||||
version = {'devicehub': dh_version, 'ereuse_tag': '0.0.0'}
|
version = {'devicehub': dh_version, 'ereuse_tag': '0.0.0'}
|
||||||
assert res.status_code == 200
|
assert res.status_code == 200
|
||||||
assert content == version
|
assert content == version
|
||||||
|
|
Reference in New Issue