62 self.assertEqual(entity.content, 'the cw web site') |
62 self.assertEqual(entity.content, 'the cw web site') |
63 self.assertEqual(entity.cwuri, 'http://www.cubicweb.org/') |
63 self.assertEqual(entity.cwuri, 'http://www.cubicweb.org/') |
64 self.assertEqual(entity.cw_source[0].name, 'myfeed') |
64 self.assertEqual(entity.cw_source[0].name, 'myfeed') |
65 self.assertEqual(entity.cw_metainformation(), |
65 self.assertEqual(entity.cw_metainformation(), |
66 {'type': 'Card', |
66 {'type': 'Card', |
67 'source': {'uri': 'system', 'type': 'native'}, |
67 'source': {'uri': 'myfeed', 'type': 'datafeed'}, |
68 'extid': 'http://www.cubicweb.org/'} |
68 'extid': 'http://www.cubicweb.org/'} |
69 ) |
69 ) |
70 # test repo cache keys |
70 # test repo cache keys |
71 self.assertEqual(self.repo._type_source_cache[entity.eid], |
71 self.assertEqual(self.repo._type_source_cache[entity.eid], |
72 ('Card', 'system', 'http://www.cubicweb.org/')) |
72 ('Card', 'system', 'http://www.cubicweb.org/', 'myfeed')) |
73 self.assertEqual(self.repo._extid_cache[('http://www.cubicweb.org/', 'system')], |
73 self.assertEqual(self.repo._extid_cache[('http://www.cubicweb.org/', 'system')], |
74 entity.eid) |
74 entity.eid) |
75 # test repull |
75 # test repull |
76 stats = dfsource.pull_data(self.session, force=True) |
76 stats = dfsource.pull_data(self.session, force=True) |
77 self.assertEqual(stats['created'], set()) |
77 self.assertEqual(stats['created'], set()) |
81 self.repo._extid_cache.clear() |
81 self.repo._extid_cache.clear() |
82 stats = dfsource.pull_data(self.session, force=True) |
82 stats = dfsource.pull_data(self.session, force=True) |
83 self.assertEqual(stats['created'], set()) |
83 self.assertEqual(stats['created'], set()) |
84 self.assertEqual(stats['updated'], set((entity.eid,))) |
84 self.assertEqual(stats['updated'], set((entity.eid,))) |
85 self.assertEqual(self.repo._type_source_cache[entity.eid], |
85 self.assertEqual(self.repo._type_source_cache[entity.eid], |
86 ('Card', 'system', 'http://www.cubicweb.org/')) |
86 ('Card', 'system', 'http://www.cubicweb.org/', 'myfeed')) |
87 self.assertEqual(self.repo._extid_cache[('http://www.cubicweb.org/', 'system')], |
87 self.assertEqual(self.repo._extid_cache[('http://www.cubicweb.org/', 'system')], |
88 entity.eid) |
88 entity.eid) |
89 |
89 |
90 self.assertEqual(dfsource.source_cwuris(self.session), |
90 self.assertEqual(dfsource.source_cwuris(self.session), |
91 {'http://www.cubicweb.org/': (entity.eid, 'Card')} |
91 {'http://www.cubicweb.org/': (entity.eid, 'Card')} |