コード例 #1
0
 def test_set_selector_codes(self):
     article = {
         'task': {'desk': 1},
         'slugline': 'Test',
         'urgency': 3
     }
     subscriber = {'name': 'ipnews'}
     f = SelectorcodeMapper()
     odbc_item = {}
     with self.app.app_context():
         f.map(article, 'A', subscriber=subscriber, formatted_item=odbc_item)
         self.assertSetEqual(set(odbc_item['selector_codes'].split()),
                             set('and axd pnd cxd 0fh 0ir 0px 0ah 0hw cxx axx cnd 0nl az pxd pxx'.split()))
コード例 #2
0
 def test_set_selector_codes(self):
     article = {'task': {'desk': 1}, 'slugline': 'Test', 'urgency': 3}
     subscriber = {'name': 'ipnews'}
     f = SelectorcodeMapper()
     odbc_item = {}
     with self.app.app_context():
         f.map(article,
               'A',
               subscriber=subscriber,
               formatted_item=odbc_item)
         self.assertSetEqual(
             set(odbc_item['selector_codes'].split()),
             set('and axd pnd cxd 0fh 0ir 0px 0ah 0hw cxx axx cnd 0nl az pxd pxx'
                 .split()))