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