Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-advanced-user-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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-advanced-user-tools
Commits
cf109d5b
Verified
Commit
cf109d5b
authored
3 years ago
by
Alexander Kreft
Browse files
Options
Downloads
Patches
Plain Diff
TST: move unittest to integrationtest
parent
08e13a67
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!22
Release 0.3
,
!17
f move test
Pipeline
#13986
passed
3 years ago
Stage: setup
Stage: cert
Stage: style
Stage: unittest
Stage: integrationtest
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
integrationtests/test_data_model.py
+16
-7
16 additions, 7 deletions
integrationtests/test_data_model.py
unittests/test_data_model.py
+0
-19
0 additions, 19 deletions
unittests/test_data_model.py
with
16 additions
and
26 deletions
integrationtests/test_data_model.py
+
16
−
7
View file @
cf109d5b
...
...
@@ -33,13 +33,6 @@ class DataModelTest(unittest.TestCase):
rt
=
db
.
execute_query
(
"
FIND RECORDTYPE TestRecord
"
,
unique
=
True
)
assert
rt
.
get_property
(
"
test
"
)
is
not
None
def
tearDown
(
self
):
try
:
tests
=
db
.
execute_query
(
"
FIND test*
"
)
tests
.
delete
()
except
Exception
:
pass
def
test_missing
(
self
):
# Test sync with missing prop
# insert propt
...
...
@@ -52,3 +45,19 @@ class DataModelTest(unittest.TestCase):
dm
.
sync_data_model
(
noquestion
=
True
)
rt
=
db
.
execute_query
(
"
FIND RECORDTYPE TestRecord
"
,
unique
=
True
)
assert
rt
.
get_property
(
"
testproperty
"
)
is
not
None
def
test_get_existing_entities
(
self
):
db
.
RecordType
(
name
=
"
TestRecord
"
).
insert
()
c
=
db
.
Container
().
extend
([
db
.
Property
(
name
=
"
test
"
),
db
.
RecordType
(
name
=
"
TestRecord
"
)])
exist
=
DataModel
.
get_existing_entities
(
c
)
assert
len
(
exist
)
==
1
assert
exist
[
0
].
name
==
"
TestRecord
"
def
tearDown
(
self
):
try
:
tests
=
db
.
execute_query
(
"
FIND test*
"
)
tests
.
delete
()
except
Exception
:
pass
This diff is collapsed.
Click to expand it.
unittests/test_data_model.py
+
0
−
19
View file @
cf109d5b
import
unittest
import
caosdb
as
db
import
pytest
from
caosadvancedtools.models.data_model
import
DataModel
class
DataModelTest
(
unittest
.
TestCase
):
def
tearDown
(
self
):
try
:
tests
=
db
.
execute_query
(
"
FIND test*
"
)
tests
.
delete
()
except
Exception
:
pass
def
test_collecting
(
self
):
maintained
=
{
"
one
"
:
db
.
RecordType
(
name
=
"
TestRecord
"
).
add_property
(
name
=
"
testproperty
"
),
...
...
@@ -24,17 +16,6 @@ class DataModelTest(unittest.TestCase):
assert
"
TestRecord
"
in
names
assert
"
testproperty
"
in
names
# TODO this seems to require integration test
@pytest.mark.xfail
(
reason
=
"
This test will need an integration test. See issue #51
"
)
def
test_get_existing_entities
(
self
):
db
.
RecordType
(
name
=
"
TestRecord
"
).
insert
()
c
=
db
.
Container
().
extend
([
db
.
Property
(
name
=
"
testproperty
"
),
db
.
RecordType
(
name
=
"
TestRecord
"
)])
exist
=
DataModel
.
get_existing_entities
(
c
)
assert
len
(
exist
)
==
1
assert
exist
[
0
].
name
==
"
TestRecord
"
def
test_sync_ids_by_name
(
self
):
container
=
db
.
Container
().
extend
([
db
.
RecordType
(
name
=
"
TestRecord
"
),
db
.
RecordType
(
name
=
"
TestRecord2
"
),
...
...
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