def test_truncate_pagemasters_slugline(self): filename = 'National Top Ten By Volume at Close - March 13.tst' dirname = os.path.dirname(os.path.realpath(__file__)) fixture = os.path.normpath(os.path.join(dirname, '../fixtures', filename)) self.provider['source'] = 'PMF' parser = ZCZCPMFParser() self.items = parser.parse(fixture, self.provider) parser.post_process_item(self.items, self.provider) self.assertEqual(self.items.get('slugline'), 'National Top Ten By Volume at ')
def test_greyhound_divs(self): filename = 'Warragul Greyhound NSW TAB DIVS 1-11 Thursday.tst' dirname = os.path.dirname(os.path.realpath(__file__)) fixture = os.path.normpath(os.path.join(dirname, '../fixtures', filename)) self.provider['source'] = 'PMF' self.items = ZCZCPMFParser().parse(fixture, self.provider) self.assertEqual(self.items.get('headline'), 'Warragul Greyhound NSW TAB DIVS 1-11 Thursday') self.assertEqual(self.items.get('slugline'), 'Warragul Greys') self.assertEqual(self.items.get('anpa_take_key'), 'NSW TAB DIVS 1-11') self.assertEqual(self.items.get('genre')[0]['name'], 'Results (sport)')
def test_pagemasters_market(self): filename = 'Caulfield RA - Betting - Sat 11 Feb, 2017.tst' dirname = os.path.dirname(os.path.realpath(__file__)) fixture = os.path.normpath(os.path.join(dirname, '../fixtures', filename)) self.provider['source'] = 'PMF' parser = ZCZCPMFParser() self.items = parser.parse(fixture, self.provider) parser.post_process_item(self.items, self.provider) self.assertEqual(self.items.get('slugline'), 'Caulfield Market') self.assertEqual(self.items.get('anpa_take_key'), 'Saturday') self.assertEqual(self.items.get('headline'), 'Caulfield Market Saturday')
def test_trot_tab_divs(self): filename = 'Wagga Trot VIC TAB DIVS 1-4 Friday.tst' dirname = os.path.dirname(os.path.realpath(__file__)) fixture = os.path.normpath(os.path.join(dirname, '../fixtures', filename)) self.provider['source'] = 'PMF' self.items = ZCZCPMFParser().parse(fixture, self.provider) self.assertEqual(self.items.get('headline'), 'Wagga Trot VIC TAB DIVS 1-4 Friday') self.assertEqual(self.items.get('slugline'), 'Wagga Trot') self.assertEqual(self.items.get('anpa_category')[0]['qcode'], 'r') self.assertEqual(self.items.get('subject')[0]['qcode'], '15030003') self.assertEqual(self.items.get('genre')[0]['name'], 'Results (sport)')
def test_pagemasters_format(self): filename = 'Darwin GR - Greys - Sun 11 Oct, 2015.tst' dirname = os.path.dirname(os.path.realpath(__file__)) fixture = os.path.normpath(os.path.join(dirname, '../fixtures', filename)) self.provider['source'] = 'PMF' self.items = ZCZCPMFParser().parse(fixture, self.provider) self.assertEqual(self.items.get('headline'), 'Darwin Greyhound Fields Sunday') self.assertEqual(self.items.get('slugline'), 'Darwin Grey') self.assertEqual(self.items.get('anpa_category')[0]['qcode'], 'r') self.assertEqual(self.items.get('subject')[0]['qcode'], '15082000') self.assertEqual(self.items.get('genre')[0]['name'], 'Results (sport)')