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
3c8b6e91
Commit
3c8b6e91
authored
7 months ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
TST: Add unittest for
https://gitlab.com/linkahead/linkahead-pylib/-/issues/128
parent
0f1c30c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!149
Release 0.15.1
,
!148
F fix datetime value
Pipeline
#54240
failed
7 months ago
Stage: code_style
Stage: linting
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittests/test_issues.py
+24
-0
24 additions, 0 deletions
unittests/test_issues.py
with
24 additions
and
0 deletions
unittests/test_issues.py
+
24
−
0
View file @
3c8b6e91
...
...
@@ -24,6 +24,7 @@ import os
import
lxml
import
linkahead
as
db
from
datetime
import
date
,
datetime
from
pytest
import
raises
...
...
@@ -64,3 +65,26 @@ def test_issue_156():
# </ParentList>
assert
value
is
project
assert
parents
[
0
].
name
==
"
RTName
"
def
test_issue_128
():
"""
Test assigning datetime.date(time) values to DATETIME
properties:
https://gitlab.com/linkahead/linkahead-pylib/-/issues/128.
"""
prop
=
db
.
Property
(
name
=
"
TestDatetime
"
,
datatype
=
db
.
DATETIME
)
prop_list
=
db
.
Property
(
name
=
"
TestListDatetime
"
,
datatype
=
db
.
LIST
(
db
.
DATETIME
))
today
=
date
.
today
()
now
=
datetime
.
now
()
prop
.
value
=
today
assert
prop
.
value
==
today
prop
.
value
=
now
assert
prop
.
value
==
now
prop_list
.
value
=
[
today
,
today
]
assert
prop_list
.
value
==
[
today
,
today
]
prop_list
.
value
=
[
now
,
now
]
assert
prop_list
.
value
==
[
now
,
now
]
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