dataimport/test/unittest_importer.py
changeset 10807 bb0c7dbd1fe7
parent 10514 b29d9904482e
child 10809 359cbdf3a515
equal deleted inserted replaced
10806:bd98cd3b7869 10807:bb0c7dbd1fe7
   165         self.assertNotIn('cwuri', personne.values)
   165         self.assertNotIn('cwuri', personne.values)
   166 
   166 
   167 
   167 
   168 def extentities_from_csv(fpath):
   168 def extentities_from_csv(fpath):
   169     """Yield ExtEntity read from `fpath` CSV file."""
   169     """Yield ExtEntity read from `fpath` CSV file."""
   170     with open(fpath) as f:
   170     with open(fpath, 'rb') as f:
   171         for uri, name, knows in ucsvreader(f, skipfirst=True, skip_empty=False):
   171         for uri, name, knows in ucsvreader(f, skipfirst=True, skip_empty=False):
   172             yield ExtEntity('Personne', uri,
   172             yield ExtEntity('Personne', uri,
   173                             {'nom': set([name]), 'connait': set([knows])})
   173                             {'nom': set([name]), 'connait': set([knows])})
   174 
   174 
   175 
   175