Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
s3storage
Commits
1733de7c6233
Commit
978f082e
authored
Feb 10, 2021
by
Arthur Lutz
Browse files
[test/test_s3storage] add a test for two identical files created in same transaction
parent
f657582ffdf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test_s3storage.py
View file @
1733de7c
...
...
@@ -41,6 +41,17 @@ class S3StorageTC(testing.S3StorageTestMixin, CubicWebTC):
data
=
self
.
s3_bucket
.
Object
(
key
).
get
()[
'Body'
].
read
()
self
.
assertEqual
(
data
,
b
'some content'
)
def
test_entity_create_two_files_in_transaction
(
self
):
with
self
.
admin_access
.
client_cnx
()
as
cnx
:
eid
=
create_image
(
cnx
,
b
'some content'
).
eid
_
=
create_image
(
cnx
,
b
'some content'
).
eid
cnx
.
commit
()
key
=
cnx
.
execute
(
'Any STKEY(D) WHERE X is Image, X data D, '
'X eid %(eid)s'
,
{
'eid'
:
eid
}).
rows
[
0
][
0
]
key
=
key
.
getvalue
().
decode
()
data
=
self
.
s3_bucket
.
Object
(
key
).
get
()[
'Body'
].
read
()
self
.
assertEqual
(
data
,
b
'some content'
)
def
test_entity_modify
(
self
):
with
self
.
admin_access
.
client_cnx
()
as
cnx
:
eid
=
create_image
(
cnx
,
b
'some content'
).
eid
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment