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
5fea5d55bd6f
Commit
4a8b65be
authored
Feb 23, 2021
by
Elouan Martinet
Browse files
[test] Try to upload two files with the same key
parent
1733de7c6233
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test_s3storage.py
View file @
5fea5d55
...
...
@@ -41,8 +41,10 @@ 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
:
def
test_entity_create_with_same_key
(
self
):
with
self
.
admin_access
.
client_cnx
()
as
cnx
,
\
patch
(
'cubicweb_s3storage.storages.S3Storage.new_s3_key'
,
return_value
=
'shared-key'
):
eid
=
create_image
(
cnx
,
b
'some content'
).
eid
_
=
create_image
(
cnx
,
b
'some content'
).
eid
cnx
.
commit
()
...
...
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