def test_parsing(self):
     parser = DepartmentParser('', 2009, '')
     data = parser.parse(HtmlXPathSelector(self.response))
     for key in ['tipp', 'property_tax_basis', 'property_tax_value',
                 'business_tax_value', 'home_tax_value',
                 'property_tax_rate', 'home_tax_rate']:
         self.assertTrue(key in data)
 def test_parsing(self):
     parser = DepartmentParser('', 2011, '')
     data = parser.parse(HtmlXPathSelector(self.response))
     for key in ['tipp', 'property_tax_basis', 'property_tax_value',
                 'property_tax_cuts_on_deliberation', 'property_tax_rate',
                 'business_profit_contribution_basis',
                 'business_network_tax_value']:
         self.assertTrue(key in data)
    def test_parsing(self):
        parser = DepartmentParser('', 2012, '')
        data = parser.parse(HtmlXPathSelector(self.response))
        self.assertEqual(data['allocation'], 52327 * 1e3)
        self.assertEqual(data['name'], 'CANTAL')
        self.assertEqual(data['population'], 148380)
        # test data parsed from first table
        self.assertEqual(data['operating_revenues'], 199333000)
        self.assertEqual(data['direct_tax'], 41983000)
        self.assertEqual(data['tipp'], 10860000)
        self.assertEqual(data['operating_costs'], 185946000.)

        # test data parsed from second table
        self.assertEqual(data['property_tax_basis'], 129386000)
        self.assertEqual(data['property_tax_value'], 30483000)
        self.assertAlmostEqual(data['property_tax_rate'], 0.2356)