Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
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-pylib
Commits
95d169c6
Unverified
Commit
95d169c6
authored
5 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
FIX: fix test
parent
01e59d51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittests/test_entity.py
+6
-4
6 additions, 4 deletions
unittests/test_entity.py
with
6 additions
and
4 deletions
unittests/test_entity.py
+
6
−
4
View file @
95d169c6
...
@@ -25,7 +25,8 @@
...
@@ -25,7 +25,8 @@
# pylint: disable=missing-docstring
# pylint: disable=missing-docstring
import
unittest
import
unittest
from
caosdb
import
Entity
,
Property
,
Record
,
RecordType
,
configure_connection
from
caosdb
import
(
INTEGER
,
Entity
,
Property
,
Record
,
RecordType
,
configure_connection
)
from
caosdb.connection.mockup
import
MockUpServerConnection
from
caosdb.connection.mockup
import
MockUpServerConnection
...
@@ -54,7 +55,7 @@ class TestEntity(unittest.TestCase):
...
@@ -54,7 +55,7 @@ class TestEntity(unittest.TestCase):
def
test_apply_to_ids
(
self
):
def
test_apply_to_ids
(
self
):
parent
=
RecordType
(
id
=
3456
)
parent
=
RecordType
(
id
=
3456
)
rec
=
Record
(
id
=
23
)
rec
=
Record
(
id
=
23
)
p
=
Property
(
id
=
23345
)
p
=
Property
(
id
=
23345
,
datatype
=
INTEGER
)
rec
.
add_parent
(
parent
)
rec
.
add_parent
(
parent
)
rec
.
add_property
(
p
)
rec
.
add_property
(
p
)
...
@@ -62,8 +63,9 @@ class TestEntity(unittest.TestCase):
...
@@ -62,8 +63,9 @@ class TestEntity(unittest.TestCase):
return
id_
*
-
1
return
id_
*
-
1
rec
.
apply_to_ids
(
invert
)
rec
.
apply_to_ids
(
invert
)
self
.
assertEqual
(
parent
.
id
,
-
3456
)
self
.
assertEqual
(
invert
(
3456
),
-
3456
)
self
.
assertEqual
(
p
.
id
,
-
23345
)
self
.
assertEqual
(
rec
.
parents
[
0
].
id
,
-
3456
)
self
.
assertEqual
(
rec
.
properties
[
0
].
id
,
-
23345
)
self
.
assertEqual
(
rec
.
id
,
-
23
)
self
.
assertEqual
(
rec
.
id
,
-
23
)
def
test_instanciation
(
self
):
def
test_instanciation
(
self
):
...
...
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