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
908593dc
Verified
Commit
908593dc
authored
1 year ago
by
Timm Fitschen
Browse files
Options
Downloads
Plain Diff
Merge branch 'f-filesystem-link' into f-filesystem-import
parents
6434fb2c
254e018a
No related branches found
No related tags found
1 merge request
!53
Draft: ENH: file system: import
Pipeline
#49059
failed
1 year ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/test_administration.py
+4
-4
4 additions, 4 deletions
tests/test_administration.py
tests/test_datatype_inheritance.py
+5
-4
5 additions, 4 deletions
tests/test_datatype_inheritance.py
tests/test_issues_server.py
+29
-6
29 additions, 6 deletions
tests/test_issues_server.py
with
38 additions
and
14 deletions
tests/test_administration.py
+
4
−
4
View file @
908593dc
...
...
@@ -26,10 +26,10 @@
@author: tf
"""
from
caosdb
import
administration
as
admin
,
Info
,
get_config
from
caosdb
.connection.connection
import
configure_connection
,
get_connection
from
caosdb
.exceptions
import
(
HTTPClientError
,
HTTPForbiddenError
,
LoginFailedError
,
HTTPResourceNotFoundError
)
from
linkahead
import
administration
as
admin
,
Info
,
get_config
from
linkahead
.connection.connection
import
configure_connection
,
get_connection
from
linkahead
.exceptions
import
(
HTTPClientError
,
HTTPForbiddenError
,
LoginFailedError
,
HTTPResourceNotFoundError
)
from
pytest
import
raises
,
mark
test_role
=
"
test_role
"
...
...
This diff is collapsed.
Click to expand it.
tests/test_datatype_inheritance.py
+
5
−
4
View file @
908593dc
...
...
@@ -27,7 +27,7 @@ import caosdb as db
from
caosdb.connection.connection
import
get_connection
from
caosdb.exceptions
import
TransactionError
from
pytest
import
raises
from
pytest
import
mark
,
raises
def
setup_function
(
function
):
...
...
@@ -154,6 +154,7 @@ def test_datatype_overriding_update():
assert
str
(
"
DATETIME
"
).
lower
()
==
rt
.
get_properties
()[
0
].
datatype
.
lower
()
@mark.xfail
(
reason
=
"
https://gitlab.com/linkahead/linkahead-server/-/issues/257
"
)
def
test_recordtype_to_record
():
rt
=
RecordType
(
name
=
"
SimpleTextRecordType
"
)
rt
.
datatype
=
"
TEXT
"
...
...
@@ -169,9 +170,9 @@ def test_recordtype_to_record():
rec
=
Record
().
add_parent
(
name
=
"
SimpleTextRecordType
"
).
insert
()
assert
rec
.
is_valid
()
# T
ODO
#
assert rec.datatype is not None
#
assert str("TEXT").lower() == rec.datatype.lower()
# T
his fails to inherit the datatype
assert
rec
.
datatype
is
not
None
assert
str
(
"
TEXT
"
).
lower
()
==
rec
.
datatype
.
lower
()
def
test_concrete_property
():
...
...
This diff is collapsed.
Click to expand it.
tests/test_issues_server.py
+
29
−
6
View file @
908593dc
# -*- coding: utf-8 -*-
# This file is a part of the CaosDB Project.
#
# Copyright (c) 2020 - 202
2
IndiScale GmbH <info@indiscale.com>
# Copyright (c) 2020 - 202
4
IndiScale GmbH <info@indiscale.com>
# Copyright (c) 2022 Daniel Hornung <d.hornung@indiscale.com>
# Copyright (c) 2020 Florian Spreckelsen <f.spreckelsen@indiscale.com>
# Copyright (c) 2021 - 202
2
Timm Fitschen <t.fitschen@indiscale.com>
# Copyright (c) 2021 - 202
4
Timm Fitschen <t.fitschen@indiscale.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
...
...
@@ -19,18 +19,18 @@
# 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/>.
"""
Tests for issues on gitlab.com, project
caosdb
-server.
"""
"""
Tests for issues on gitlab.com, project
linkahead
-server.
"""
import
math
import
os
import
tempfile
import
time
import
caosdb
as
db
import
linkahead
as
db
import
pytest
from
caosdb
import
administration
as
admin
from
caosdb
.exceptions
import
(
TransactionError
,
HTTPClientError
,
HTTPURITooLongError
)
from
linkahead
import
administration
as
admin
from
linkahead
.exceptions
import
(
TransactionError
,
HTTPClientError
,
HTTPURITooLongError
)
CURATOR_ROLE
=
"
curator
"
...
...
@@ -1453,3 +1453,26 @@ def test_235_long_name():
except
Exception
as
exc
:
assert
not
isinstance
(
exc
,
db
.
HTTPServerError
)
# TODO more specific error should be asserted
@pytest.mark.xfail
(
reason
=
"
https://gitlab.com/linkahead/linkahead-server/-/issues/248
"
)
def
test_248
():
"""
Querying for entities with property fails if using ID.
"""
rt
=
db
.
RecordType
(
name
=
"
RT1
"
).
insert
()
prop
=
db
.
Property
(
name
=
"
prop
"
,
datatype
=
db
.
DOUBLE
).
insert
()
rec
=
db
.
Record
().
add_parent
(
rt
).
add_property
(
prop
,
value
=
23
).
insert
()
results
=
db
.
execute_query
(
f
"
FIND Entity with
{
prop
.
id
}
"
)
assert
len
(
results
)
==
1
@pytest.mark.xfail
(
reason
=
"
https://gitlab.com/linkahead/linkahead-server/-/issues/253
"
)
def
test_253
():
"""
Value in string queries may not start with large number of digits.
"""
test_strings
=
[
"
0123456789
"
,
"
hello
"
+
"
0123456789
"
*
5
+
"
world
"
,
"
0123456789
"
*
5
+
"
world
"
,
]
for
string
in
test_strings
:
results
=
db
.
execute_query
(
f
"
FIND Entity with prop=
{
string
}
"
)
assert
len
(
results
)
==
0
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