[PATCH saem] [seda] Add 'ark:/' prefix to ArchiveProfil identifier

Sylvain Thénault sylvain.thenault at logilab.fr
Tue Jun 6 10:26:52 CEST 2017



Le 06/06/2017 à 10:21, Sylvain Thenault a écrit :
> # HG changeset patch
> # User Sylvain Thénault <sylvain.thenault at logilab.fr>
> # Date 1496294330 -7200
> #      Thu Jun 01 07:18:50 2017 +0200
> # Node ID bc221b794585ac69e2fb9e784e2bea843579f372
> # Parent  8ca8cd6800380cade46c17b39e59245b0318abae
> # Available At http://hg.logilab.org/review/cubes/saem_ref
> #              hg pull http://hg.logilab.org/review/cubes/saem_ref -r bc221b794585
> [seda] Add 'ark:/' prefix to ArchiveProfil identifier
>
> consistently with record ids exposed in OAI.
>
> Closes extranet #XXX

sent a v2 with a real ticket number
>
> diff --git a/cubicweb_saem_ref/entities/seda.py b/cubicweb_saem_ref/entities/seda.py
> --- a/cubicweb_saem_ref/entities/seda.py
> +++ b/cubicweb_saem_ref/entities/seda.py
> @@ -45,11 +45,11 @@ orig_xsd_archival_agreement = SEDA1XSDEx
>  
>  @monkeypatch(SEDA1XSDExport)
>  def xsd_archival_agreement(self, parent, transfer):
>      orig_xsd_archival_agreement(self, parent, transfer)
>      self.element_schema(parent, 'ArchivalProfile', 'qdt:ArchivesIDType',
> -                        fixed_value=transfer.ark)
> +                        fixed_value=u'ark:/' + transfer.ark)
>  
>  
>  # override agency_id to return ark instead of eid
>  @monkeypatch(SEDA1XSDExport)
>  def agency_id(self, agency):
> diff --git a/test/test_seda.py b/test/test_seda.py
> --- a/test/test_seda.py
> +++ b/test/test_seda.py
> @@ -73,11 +73,11 @@ class SEDAExportTC(CubicWebTC):
>              transfer = testutils.seda_transfer(cnx)
>              testutils.create_archive_unit(transfer)
>              cnx.commit()
>              for xml in self.iter_seda_xsd(transfer):
>                  self.assertIn('ArchivalProfile', xml)
> -                self.assertIn(transfer.ark, xml)
> +                self.assertIn('ark:/' + transfer.ark, xml)
>  
>      def test_include_agency_ark(self):
>          with self.admin_access.client_cnx() as cnx:
>              transfer = testutils.seda_transfer(cnx)
>              _, _, unit_alt_seq = testutils.create_archive_unit(transfer)
>

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org



More information about the saem-devel mailing list