Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P580
(An Untitled Masterwork)
Active
Public
Actions
Authored by
douardda
on Dec 20 2019, 2:12 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
ardumont
def
test_create_deposit_multipart
(
host
):
deposit
=
host
.
check_output
(
'swh deposit upload --format json --username test --password test '
'--url http://nginx:5080/deposit/1 '
'--archive /tmp/archive.zip '
'--partial'
)
deposit
=
json
.
loads
(
deposit
)
assert
set
(
deposit
.
keys
())
==
{
'deposit_id'
,
'deposit_status'
,
'deposit_status_detail'
,
'deposit_date'
}
assert
deposit
[
'deposit_status'
]
==
'partial'
deposit_id
=
deposit
[
'deposit_id'
]
deposit
=
host
.
check_output
(
'swh deposit upload --format json --username test --password test '
'--url http://nginx:5080/deposit/1 '
'--metadata /tmp/metadata.xml'
)
deposit
=
json
.
loads
(
deposit
)
assert
deposit
[
'deposit_status'
]
==
'deposited'
assert
deposit
[
'deposit_id'
]
==
deposit_id
for
i
in
range
(
60
):
status
=
json
.
loads
(
host
.
check_output
(
'swh deposit status --format json --username test --password test '
'--url http://nginx:5080/deposit/1 --deposit-id
%s
'
%
deposit_id
))
if
status
[
'deposit_status'
]
==
'done'
:
break
time
.
sleep
(
1
)
else
:
assert
False
,
"Deposit loading failed; current status is
%s
"
%
status
Event Timeline
douardda
created this paste.
Dec 20 2019, 2:12 PM
2019-12-20 14:12:11 (UTC+1)
ardumont
added a subscriber:
ardumont
.
Dec 20 2019, 2:21 PM
2019-12-20 14:21:11 (UTC+1)
Comment Actions
line 19:
add --deposit-id {deposit_id} so that you work with the deposit you want to update.
Log In to Comment