[PATCH eac] Fix error on extid comparison on tests

gvandevelde guillaume.vandevelde at logilab.fr
Tue Sep 3 16:33:54 CEST 2019


Yes. In fact It is already breaking at the previous published changeset.

It's because of the test database that was not removed I think.

Must be carefull on that.

I make you a changeset for that.

On 9/3/19 3:43 PM, Frank Bessou wrote:
> 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):
>>
>



More information about the saem-devel mailing list