adding test of get version

This commit is contained in:
Cayo Puigdefabregas 2020-09-18 11:32:20 +02:00
parent 3d171626f3
commit aaaf118028
1 changed files with 13 additions and 1 deletions

View File

@ -1,8 +1,10 @@
import datetime
import pkg_resources
import pytest
from uuid import UUID
from flask import g
import pytest
from colour import Color
from ereuse_utils.naming import Naming
from ereuse_utils.test import ANY
@ -116,6 +118,16 @@ def test_users(user: UserClient, client: Client):
assert res.status_code == 405
@pytest.mark.mvp
def test_get_version(app: Devicehub, client: Client):
"""Checks GETting versions of services."""
content, res = client.get("/versions/", None)
dh_version = pkg_resources.require('ereuse-devicehub')[0].version
version = {'devicehub': dh_version, 'ereuse_tag': '0.0.0'}
assert res.status_code == 200
assert content == version
@pytest.mark.mvp
def test_get_device(app: Devicehub, user: UserClient, user2: UserClient):
"""Checks GETting a d.Desktop with its components."""