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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Python Integration Tests
Commits
af9114ee
Commit
af9114ee
authored
6 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: cosmetics
parent
968133d4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
setup.py
+0
-1
0 additions, 1 deletion
setup.py
tests/test_tickets.py
+37
-8
37 additions, 8 deletions
tests/test_tickets.py
with
37 additions
and
9 deletions
setup.py
+
0
−
1
View file @
af9114ee
...
...
@@ -5,4 +5,3 @@ setup(
packages
=
find_packages
(),
tests_require
=
[
"
nose>=1.0
"
],
)
This diff is collapsed.
Click to expand it.
tests/test_tickets.py
+
37
−
8
View file @
af9114ee
...
...
@@ -26,13 +26,17 @@
@author: tf
"""
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
import
caosdb
as
db
from
tests
import
test_misc
from
caosdb.exceptions
import
CaosDBException
,
TransactionError
,
EntityError
,
UniqueNamesError
,
AmbiguityException
,
EntityDoesNotExistError
from
nose.tools
import
(
nottest
,
assert_true
,
assert_raises
,
assert_not_equals
,
assert_equals
,
assert_false
,
assert_is_not_none
,
assert_is_none
)
from
caosdb.exceptions
import
(
AmbiguityException
,
CaosDBException
,
EntityDoesNotExistError
,
EntityError
,
TransactionError
,
UniqueNamesError
)
from
nose
import
with_setup
from
nose.tools
import
(
assert_equals
,
assert_false
,
assert_is_none
,
assert_is_not_none
,
assert_raises
,
assert_true
,
nottest
)
from
tests
import
test_misc
def
setup_module
():
...
...
@@ -62,6 +66,7 @@ def test_ticket_103a():
for
w
in
rt
.
get_warnings
():
haswarnings
=
True
break
assert_true
(
haswarnings
)
...
...
@@ -73,6 +78,7 @@ def test_ticket_103a():
for
w
in
rt
.
get_warnings
():
haswarnings
=
True
break
assert_true
(
haswarnings
)
...
...
@@ -86,13 +92,17 @@ def test_ticket_103a():
assert_equals
(
128
,
int
(
exc
.
get_code
()))
rt
=
exc
.
get_entities
()[
0
]
assert_false
(
rt
.
is_valid
())
for
w
in
rt
.
get_warnings
():
haswarnings
=
True
break
assert_true
(
haswarnings
)
for
w
in
rt
.
get_errors
():
if
w
.
get_code
()
==
128
:
hasstricterror
=
True
break
assert_true
(
hasstricterror
)
finally
:
...
...
@@ -108,13 +118,17 @@ def test_ticket_103a():
try
:
rt
.
insert
(
strict
=
True
,
raise_exception_on_error
=
False
)
assert_false
(
rt
.
is_valid
())
for
w
in
rt
.
get_warnings
():
haswarnings
=
True
break
assert_true
(
haswarnings
)
for
w
in
rt
.
get_errors
():
if
w
.
get_code
()
==
128
:
hasstricterror
=
True
break
assert_true
(
hasstricterror
)
finally
:
...
...
@@ -323,7 +337,8 @@ def test_ticket_120():
assert_equals
(
r3
.
id
,
cr3
.
id
)
cr3
=
db
.
Query
(
"
FIND RECORD WHICH HAS A PROPERTY blabla=4 OR SimpleRT1->SimpleRT2 WHICH HAS A PROPERTY SimpleRT1->
"
+
"
FIND RECORD WHICH HAS A PROPERTY blabla=4 OR SimpleRT1->SimpleRT2
"
"
WHICH HAS A PROPERTY SimpleRT1->
"
+
str
(
r1
.
id
)
+
""
).
execute
(
...
...
@@ -336,7 +351,8 @@ def test_ticket_120():
assert_equals
(
r3
.
id
,
cr3
.
id
)
cr3
=
db
.
Query
(
"
FIND RECORD SimpleRT1 . SimpleRT1.SimpleRT1.SimpleDoubleProperty=
'
3.14
'"
"
FIND RECORD SimpleRT1 .
"
"
SimpleRT1.SimpleRT1.SimpleDoubleProperty=
'
3.14
'"
).
execute
(
unique
=
True
)
assert_equals
(
r3
.
id
,
cr3
.
id
)
...
...
@@ -412,6 +428,7 @@ def test_ticket_106():
try
:
rt
=
db
.
RecordType
(
name
=
"
test RT 2
"
)
rt
.
insert
()
while
True
:
try
:
rt
.
insert
()
...
...
@@ -419,6 +436,7 @@ def test_ticket_106():
"
2nd insert should raise an TransactionError
"
)
except
db
.
exceptions
.
TransactionError
as
e
:
print
(
e
)
break
finally
:
rt
.
delete
()
...
...
@@ -608,11 +626,13 @@ def test_ticket_39():
path
=
"
testfiles/file1
"
,
from_location
=
testfile
).
insert
()
except
EntityError
as
e
:
assert_equals
(
"
Insufficient read permission for this file. Please make it readable.
"
,
"
Insufficient read permission for this file.
"
"
Please make it readable.
"
,
e
.
msg
)
finally
:
os
.
chmod
(
testfile
,
0o600
)
if
len
(
db
.
execute_query
(
"
FIND RT1
"
))
>
0
:
rt1
.
delete
()
try
:
...
...
@@ -804,6 +824,7 @@ def test_ticket_147():
r5
=
db
.
Record
().
add_parent
(
bmsim
).
add_property
(
tstep
,
value
=
"
0.003
"
)
c
.
extend
([
r1
,
r2
,
r3
,
r4
,
r5
]).
insert
()
assert_true
(
c
.
is_valid
())
for
e
in
c
:
assert_true
(
e
.
is_valid
())
...
...
@@ -1083,6 +1104,7 @@ def test_ticket_166():
r5
=
db
.
Record
().
add_parent
(
bmsim
).
add_property
(
tstep
,
value
=
"
0.003
"
)
c
.
extend
([
r1
,
r2
,
r3
,
r4
,
r5
]).
insert
()
assert_true
(
c
.
is_valid
())
for
e
in
c
:
assert_true
(
e
.
is_valid
())
...
...
@@ -1113,6 +1135,7 @@ def test_ticket_166():
q
.
putFlag
(
"
P
"
,
"
0L5
"
)
ret
=
q
.
execute
()
assert_equals
(
5
,
len
(
ret
))
for
e
in
ret
:
assert_equals
(
bmsim
.
id
,
e
.
get_parents
()[
0
].
id
)
...
...
@@ -1120,6 +1143,7 @@ def test_ticket_166():
q
.
putFlag
(
"
P
"
,
"
5L4
"
)
ret
=
q
.
execute
()
assert_equals
(
4
,
len
(
ret
))
for
e
in
ret
:
assert_equals
(
frm
.
id
,
e
.
get_parents
()[
0
].
id
)
...
...
@@ -1305,6 +1329,7 @@ def test_ticket_165():
c
=
db
.
Container
().
extend
([
p
,
rt_a
,
rt_b
,
r_a
]).
insert
()
assert_true
(
c
.
is_valid
())
for
e
in
c
:
assert_true
(
e
.
is_valid
())
...
...
@@ -1438,18 +1463,22 @@ def test_ticket_174():
assert_true
(
c
.
is_valid
())
assert_true
(
rt1
.
is_valid
())
for
i
in
range
(
len
(
rt1
.
get_properties
())):
assert_equals
(
i
+
1.0
,
float
(
rt1
.
get_properties
()[
i
].
value
))
assert_true
(
rt2
.
is_valid
())
for
i
in
range
(
len
(
rt2
.
get_properties
())):
assert_equals
(
i
+
1.0
,
float
(
rt2
.
get_properties
()[
i
].
value
))
assert_true
(
rt3
.
is_valid
())
for
i
in
range
(
len
(
rt3
.
get_properties
())):
assert_equals
(
i
+
1.0
,
float
(
rt3
.
get_properties
()[
i
].
value
))
assert_true
(
rt4
.
is_valid
())
for
i
in
range
(
len
(
rt4
.
get_properties
())):
assert_equals
(
i
+
1.0
,
float
(
rt4
.
get_properties
()[
i
].
value
))
...
...
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