Skip to content
Snippets Groups Projects
Commit 22dcfd0f authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

New upstream version 0.0.38

parents c8e83149 eff33911
No related branches found
Tags debian/upstream/0.0.11
No related merge requests found
Metadata-Version: 2.1
Name: swh.deposit
Version: 0.0.37
Version: 0.0.38
Summary: Software Heritage Deposit Server
Home-page: https://forge.softwareheritage.org/source/swh-deposit/
Author: Software Heritage developers
......
Metadata-Version: 2.1
Name: swh.deposit
Version: 0.0.37
Version: 0.0.38
Summary: Software Heritage Deposit Server
Home-page: https://forge.softwareheritage.org/source/swh-deposit/
Author: Software Heritage developers
......
......@@ -41,6 +41,9 @@ class SWHDepositStatus(SWHBaseDeposit):
'status_detail': DEPOSIT_STATUS_DETAIL[deposit.status],
}
if deposit.swh_id:
context['swh_id'] = deposit.swh_id
return render(req, 'deposit/status.xml',
context=context,
content_type='application/xml',
......
......@@ -4,4 +4,5 @@
<deposit_id>{{ deposit_id }}</deposit_id>
<deposit_status>{{ status }}</deposit_status>
<deposit_status_detail>{{ status_detail }}</deposit_status_detail>
{% if swh_id is not None %}<deposit_swh_id>{{ swh_id }}</deposit_swh_id>{% endif %}
</entry>
......@@ -10,7 +10,8 @@ from nose.tools import istest
from rest_framework import status
from rest_framework.test import APITestCase
from swh.deposit.models import Deposit
from swh.deposit.models import Deposit, DEPOSIT_STATUS_DETAIL
from swh.deposit.models import DEPOSIT_STATUS_LOAD_SUCCESS
from swh.deposit.parsers import parse_xml
from ..common import BasicTestCase, WithAuthTestCase, FileSystemCreationRoutine
......@@ -66,7 +67,35 @@ class DepositStatusTestCase(APITestCase, WithAuthTestCase, BasicTestCase,
DEPOSIT_STATUS_READY_FOR_CHECKS)
self.assertEqual(
r['{http://www.w3.org/2005/Atom}deposit_status_detail'],
'Deposit is ready for additional checks (tarball ok, etc...)')
DEPOSIT_STATUS_DETAIL[DEPOSIT_STATUS_READY_FOR_CHECKS])
@istest
def status_with_swh_id(self):
_status = DEPOSIT_STATUS_LOAD_SUCCESS
_swh_id = '548b3c0a2bb43e1fca191e24b5803ff6b3bc7c10'
# given
deposit_id = self.create_deposit_with_status(
status=_status,
swh_id=_swh_id)
url = reverse(STATE_IRI, args=[self.collection.name, deposit_id])
# when
status_response = self.client.get(url)
# then
self.assertEqual(status_response.status_code, status.HTTP_200_OK)
r = parse_xml(BytesIO(status_response.content))
self.assertEqual(r['{http://www.w3.org/2005/Atom}deposit_id'],
deposit_id)
self.assertEqual(r['{http://www.w3.org/2005/Atom}deposit_status'],
_status)
self.assertEqual(
r['{http://www.w3.org/2005/Atom}deposit_status_detail'],
DEPOSIT_STATUS_DETAIL[DEPOSIT_STATUS_LOAD_SUCCESS])
self.assertEqual(r['{http://www.w3.org/2005/Atom}deposit_swh_id'],
_swh_id)
@istest
def status_on_unknown_deposit(self):
......
v0.0.37-0-g7ecef54
\ No newline at end of file
v0.0.38-0-geff3391
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment