Page MenuHomeSoftware Heritage
Paste P580

(An Untitled Masterwork)
ActivePublic

Authored by douardda on Dec 20 2019, 2:12 PM.
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

line 19:

add --deposit-id {deposit_id} so that you work with the deposit you want to update.