[PATCH eac] Fix error on extid comparison on tests

Frank Bessou frank.bessou at logilab.fr
Tue Sep 3 15:43:41 CEST 2019


On 03/09/2019 11:33, Guillaume Vandevelde wrote:
> # HG changeset patch
> # User Guillaume Vandevelde <gvandevelde at logilab.fr>
> # Date 1567502975 -7200
> #      Tue Sep 03 11:29:35 2019 +0200
> # Node ID 7e0248b5fe8f3b01eb44a820b8d3ee196a3c84a8
> # Parent  529f93fa0fee289de55b2c6fea3639a049725107
> # Available At http://hg.logilab.org/review/cubes/eac
> #              hg pull http://hg.logilab.org/review/cubes/eac -r 7e0248b5fe8f
> Fix error on extid comparison on tests
> 
> Some tests didn't pass because of some set comparison. Fixed it
> by comparing a sorted list representation of this set.
> This error happening only on one entity, there is certainly more
> about it that should be investigated.


The test is still failing for another reason:

self = <test_dataimport.EACDataImportTC testMethod=test_FRAD033_EAC_00001>

     def test_FRAD033_EAC_00001(self):
         fpath = self.datapath('FRAD033_EAC_00001_simplified.xml')
         with self.admin_access.repo_cnx() as cnx:
             # create a skos concept to ensure it's used instead of a 
ExternalUri
             scheme = cnx.create_entity('ConceptScheme')
             scheme.add_concept(u'environnement',
 
cwuri=u'http://data.culture.fr/thesaurus/page/ark:/67717/T1-1074') 
 

             cnx.commit()
             created, updated = testutils.eac_import(cnx, fpath)
 >           self.assertEqual(len(created), 73)
E           AssertionError: 77 != 73

> 
> diff -r 529f93fa0fee -r 7e0248b5fe8f test/test_dataimport.py
> --- a/test/test_dataimport.py	Thu Aug 08 18:46:19 2019 +0200
> +++ b/test/test_dataimport.py	Tue Sep 03 11:29:35 2019 +0200
> @@ -795,7 +795,8 @@
>                               ctx='%s/extids' % etype)
>               for extid, values in edict.items():
>                   self.ctx_assert('assertEqual',
> -                                tolist(entities_etype[extid]), tolist(values),
> +                                sorted(tolist(entities_etype[extid])),
> +                                sorted(tolist(values)),
>                                   ctx='%s/%s/values' % (etype, extid))
>   
>       def test_errors(self):
> 

-- 
Frank Bessou
Logilab         https://www.logilab.fr



More information about the saem-devel mailing list