Skip to content
Snippets Groups Projects
Commit d54a81c9 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'f-versioned-webui' into 'dev'

Tests for webui with build numbers

See merge request caosdb/caosdb-pyinttest!16
parents 821dd470 c9d885a0
Branches
Tags
No related merge requests found
# encoding: utf-8
#
# ** header v3.0
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com)
# Copyright (C) 2019 IndiScale GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# ** end header
#
"""Created on 2019-11-12
@author: Timm Fitschen (t.fitschen@indiscale.com)
"""
import caosdb as c
from urllib import request
from urllib.error import HTTPError
import ssl
import re
import pytest
def test_webinterface_version_build():
url = c.get_config().get("Connection", "url")
context = ssl.SSLContext()
context.verify_mode = ssl.CERT_NONE
buildNumber = request.urlopen(url + "webinterface/version/build",
context=context).read().decode("utf8")
assert re.match(r"\d+", buildNumber)
def test_webinterface():
url = c.get_config().get("Connection", "url")
context = ssl.SSLContext()
context.verify_mode = ssl.CERT_NONE
buildNumber = request.urlopen(url + "webinterface/version/build",
context=context).read().decode("utf8")
with pytest.raises(HTTPError) as e404:
request.urlopen(url + "webinterface/..", context=context)
assert e404.value.code == 404
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment