Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB Python Integration Tests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Python Integration Tests
Commits
c9d885a0
Verified
Commit
c9d885a0
authored
5 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
Tests for webui with build numbers
parent
99ddd623
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_webinterface.py
+59
-0
59 additions, 0 deletions
tests/test_webinterface.py
with
59 additions
and
0 deletions
tests/test_webinterface.py
0 → 100644
+
59
−
0
View file @
c9d885a0
# 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment