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
f970d1e2
Commit
f970d1e2
authored
5 years ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
Server 62 renaming
parent
e9315408
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
tests/test_issues_server.py
+31
-3
31 additions, 3 deletions
tests/test_issues_server.py
with
35 additions
and
3 deletions
CHANGELOG.md
+
4
−
0
View file @
f970d1e2
...
...
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added (for new features)
-
Tests for
[
#62
](
https://gitlab.com/caosdb/caosdb-server/-/issues/62
)
in caosdb-server-project, i.e., renaming of a RecordType that should
be reflected in properties with that RT as datatype.
### Changed (for changes in existing functionality)
### Deprecated (for soon-to-be removed features)
...
...
This diff is collapsed.
Click to expand it.
tests/test_issues_server.py
+
31
−
3
View file @
f970d1e2
...
...
@@ -3,8 +3,9 @@
# ** header v3.0
# This file is a part of the CaosDB Project.
#
# Copyright (c) 2020 IndiScale GmbH (www.indiscale.com)
# Copyright (c) 2020 Daniel Hornung (d.hornung@indiscale.com)
# Copyright (c) 2020 IndiScale GmbH <info@indiscale.com>
# Copyright (c) 2020 Daniel Hornung <d.hornung@indiscale.com>
# Copyright (c) 2020 Florian Spreckelsen <f.spreckelsen@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
...
...
@@ -21,9 +22,11 @@
#
# ** end header
"""
Tests for issues on gitlab.com, project caosdb-
mysqlbackend
.
"""
"""
Tests for issues on gitlab.com, project caosdb-
server
.
"""
import
caosdb
as
db
from
caosdb.exceptions
import
EntityError
import
pytest
def
setup_module
():
...
...
@@ -45,6 +48,31 @@ def teardown():
# ########################### Issue tests start here ###########################
@pytest.mark.xfail
(
reason
=
"
to be fixed in server repo
"
)
def
test_issue_62
():
"""
datatype is not changed when recordtype name changes
Tests for https://gitlab.com/caosdb/caosdb-server/-/issues/62
"""
db
.
RecordType
(
name
=
"
Test_RTA
"
).
insert
()
db
.
Property
(
name
=
"
Test_Prop
"
,
datatype
=
"
Test_RTA
"
).
insert
()
db
.
Record
(
name
=
"
Test_Record
"
).
add_parent
(
name
=
"
Test_RTA
"
).
add_property
(
name
=
"
Test_Prop
"
).
insert
()
# rename Test_RTA to Test_RTB
rtb
=
db
.
execute_query
(
"
FIND RecordType Test_RTA
"
,
unique
=
True
)
rtb
.
name
=
"
Test_RTB
"
rtb
.
update
()
# renaming has to be reflected in Test_Record and Test_Prop
rec
=
db
.
execute_query
(
"
FIND Record Test_Record
"
,
unique
=
True
)
assert
rec
.
parents
[
0
].
name
==
rtb
.
name
prop
=
db
.
execute_query
(
"
FIND Property Test_Prop
"
,
unique
=
True
)
assert
prop
.
datatype
==
rtb
.
name
# fails; datatype not updated
# Can't use Test_RTA as datatype anymore
prop2
=
db
.
Property
(
name
=
"
Test_Prop2
"
,
datatype
=
"
Test_RTA
"
)
with
pytest
.
raises
(
EntityError
):
prop2
.
insert
()
def
test_issue_85_a
():
"""
SQLIntegrityConstraintViolationException for special inheritance patterns.
...
...
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