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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Python Integration Tests
Commits
68e7681b
Verified
Commit
68e7681b
authored
2 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
STY: autopep8'ed test_file.py
parent
0db1530b
Branches
Branches containing commit
No related tags found
1 merge request
!49
Draft: ENH: file system: directory
Pipeline
#47498
failed
1 year ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
2
Pipelines
3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test_file.py
+2
-1
2 additions, 1 deletion
tests/test_file.py
tests/test_issues_pylib.py
+0
-83
0 additions, 83 deletions
tests/test_issues_pylib.py
with
2 additions
and
84 deletions
tests/test_file.py
+
2
−
1
View file @
68e7681b
...
...
@@ -476,7 +476,8 @@ def test_delete_dir_failure_not_empty():
with
raises
(
TransactionError
)
as
exc
:
directoryA
.
delete
()
assert
exc
.
value
.
msg
==
"
One or more entities are not qualified. None of them have been inserted/updated/deleted.
"
assert
exc
.
value
.
entities
[
0
].
get_errors
()[
0
].
description
==
"
Entity is required by other entities which are not to be deleted.
"
assert
exc
.
value
.
entities
[
0
].
get_errors
(
)[
0
].
description
==
"
Entity is required by other entities which are not to be deleted.
"
body
=
get_connection
().
retrieve
(
entity_uri_segments
=
[
...
...
This diff is collapsed.
Click to expand it.
tests/test_issues_pylib.py
deleted
100644 → 0
+
0
−
83
View file @
0db1530b
# encoding: utf-8
#
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2022 IndiScale GmbH <info@indiscale.com>
# Copyright (C) 2022 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 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/>.
import
caosdb
as
db
def
setup_module
():
teardown_module
()
db
.
RecordType
(
"
State
"
).
insert
()
db
.
RecordType
(
"
StateModel
"
).
insert
()
db
.
RecordType
(
"
Transition
"
).
insert
()
db
.
Property
(
name
=
"
from
"
,
datatype
=
"
State
"
).
insert
()
db
.
Property
(
name
=
"
to
"
,
datatype
=
"
State
"
).
insert
()
db
.
Property
(
name
=
"
initial
"
,
datatype
=
"
State
"
).
insert
()
db
.
Property
(
name
=
"
final
"
,
datatype
=
"
State
"
).
insert
()
def
teardown_module
():
"""
delete all entities!!!
"""
try
:
db
.
execute_query
(
"
FIND ENTITY
"
).
delete
()
except
:
pass
def
create_transition
(
name
,
fro
,
to
):
db
.
Record
(
name
).
add_parent
(
"
Transition
"
).
add_property
(
"
from
"
,
fro
).
add_property
(
"
to
"
,
to
).
insert
()
def
create_state_model
(
name
,
transitions
,
initial
,
final
):
m
=
db
.
Record
(
name
)
m
.
add_parent
(
"
StateModel
"
)
m
.
add_property
(
"
Transition
"
,
datatype
=
db
.
LIST
(
"
Transition
"
),
value
=
transitions
)
m
.
add_property
(
"
initial
"
,
initial
)
m
.
add_property
(
"
final
"
,
final
)
m
.
insert
()
def
test_issue_86
():
# two states
db
.
Record
(
"
S1
"
).
add_parent
(
"
State
"
).
insert
()
db
.
Record
(
"
S2
"
).
add_parent
(
"
State
"
).
insert
()
# three transitions
create_transition
(
"
t11
"
,
"
S1
"
,
"
S1
"
)
create_transition
(
"
t12
"
,
"
S1
"
,
"
S2
"
)
create_transition
(
"
t21
"
,
"
S2
"
,
"
S1
"
)
create_state_model
(
"
Model1
"
,
[
"
t11
"
,
"
t12
"
,
"
t21
"
],
"
S1
"
,
"
S1
"
)
# stateful record type
rt
=
db
.
RecordType
(
"
TestRT
"
)
rt
.
state
=
db
.
State
(
model
=
"
Model1
"
,
name
=
"
S1
"
)
rt
.
insert
()
# record inherits the state from the record type.
rec
=
db
.
Record
().
add_parent
(
"
TestRT
"
)
rec
.
insert
()
assert
rec
.
state
==
db
.
State
(
model
=
"
Model1
"
,
name
=
"
S1
"
)
# now try to update the record without changing the state.
p
=
db
.
Property
(
"
p1
"
,
datatype
=
db
.
TEXT
).
insert
()
rec
.
add_property
(
p
,
value
=
"
val1
"
).
update
()
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