def test_parsing(self): parser = EPCIParser('', 2008, '') data = parser.parse(HtmlXPathSelector(self.response)) for key in ['property_tax_basis', 'property_tax_value', 'home_tax_value', 'property_tax_rate', 'home_tax_rate', 'home_tax_basis', 'business_tax_value', 'business_tax_rate', 'business_tax_basis']: self.assertTrue(key in data)
def test_parsing(self): parser = EPCIParser('', 2010, '') data = parser.parse(HtmlXPathSelector(self.response)) for key in ['property_tax_basis', 'property_tax_value', 'home_tax_value', 'property_tax_rate', 'home_tax_rate', 'home_tax_cuts_on_deliberation', 'home_tax_basis', 'business_property_contribution_basis', 'business_property_contribution_cuts_on_deliberation' ]: self.assertTrue(key in data)
def test_parsing(self): parser = EPCIParser('', 2012, '') data = parser.parse(HtmlXPathSelector(self.response)) self.assertEqual(data['population'], 2701) # test data parsed from first table self.assertEqual(data['operating_revenues'], 1879000.) self.assertEqual(data['localtax'], 395000.) self.assertEqual(data['operating_costs'], 1742000.) # test data parsed from second table self.assertEqual(data['home_tax_value'], 199000.) self.assertEqual(data['home_tax_basis'], 8489000.) self.assertAlmostEqual(data['home_tax_rate'], 0.023400) self.assertEqual(data['home_tax_cuts_on_deliberation'], 33000) for key in ['property_tax_basis', 'property_tax_value', 'home_tax_value', 'property_tax_rate', 'home_tax_rate', 'business_property_contribution_basis', 'business_property_contribution_cuts_on_deliberation']: self.assertTrue(key in data)