Skip to content
Snippets Groups Projects
Verified Commit 7b54ca56 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

TST: add tests for caosdb-server#183

parent 1c7005d3
No related branches found
No related tags found
1 merge request!20TST: add tests for caosdb-server#183
Pipeline #14315 failed
......@@ -10,9 +10,9 @@ RUN apt-get update && \
-y
COPY .docker/wait-for-it.sh /wait-for-it.sh
ARG PYLIB=dev
ADD https://gitlab.com/api/v4/projects/13656973/repository/commits/${PYLIB} \
ADD https://gitlab.indiscale.com/api/v4/projects/97/repository/commits/${PYLIB} \
pylib_version.json
RUN git clone https://gitlab.com/caosdb/caosdb-pylib.git && \
RUN git clone https://gitlab.indiscale.com/caosdb/caosdb-pylib.git && \
cd caosdb-pylib && git checkout ${PYLIB} && pip3 install .
COPY . /git
......
......@@ -158,10 +158,6 @@ build-testenv:
image: docker:19.03
stage: setup
timeout: 2h
only:
- schedules
- web
- pushes
needs: []
script:
- df -h
......@@ -169,7 +165,7 @@ build-testenv:
- if [ -z "$PYLIB" ]; then
if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then
echo "Check if pylib has branch $CI_COMMIT_REF_NAME" ;
if wget https://gitlab.com/api/v4/projects/13656973/repository/branches/${CI_COMMIT_REF_NAME} ; then
if wget https://gitlab.indiscale.com/api/v4/projects/97/repository/branches/${CI_COMMIT_REF_NAME} ; then
PYLIB=$CI_COMMIT_REF_NAME ;
fi;
fi;
......
......@@ -435,3 +435,19 @@ def test_issue_170():
p2 = db.execute_query("FIND TestProp3", unique=True)
assert p2.datatype == db.LIST(db.INTEGER)
assert p2.value == [1, 2]
def test_issue_183():
"""No reasonable error when using bad datetime format.
https://gitlab.indiscale.com/caosdb/src/caosdb-server/-/issues/183
"""
# Date YYYY-MM-ddThh:mm:ss
assert db.Property(name="TestDateTime", datatype=db.DATETIME,
value="2015-05-05T20:15:00").insert().id is not None
with pytest.raises(db.TransactionError) as cm:
# Date YYYY-MM-ddThh:mm
db.Property(name="TestDateTime2", datatype=db.DATETIME,
value="2015-05-05T20:15").insert()
assert cm.value.errors[0].msg == ("Cannot parse value to datetime format "
"(yyyy-mm-dd'T'hh:mm:ss[.fffffffff][TimeZone]).")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment