self.assertIn('Rodelbahnberichte', root.find('{http://www.w3.org/2005/Atom}title').text)
self.assertEqual(len(root.findall('{http://www.w3.org/2005/Atom}entry')), count, '"{}" not found {} times'.format(bahn, count))
+ def test_bahnen(self):
+ bahnen_count = {
+ '761': 2,
+ '793': 0,
+ '100': 0,
+ '1417': 1,
+ '5': 1,
+ '228': 1,
+ '793+100': 0,
+ '761+1417+5+228': 5,
+ }
+ for bahnen, count in bahnen_count.items():
+ result = self.app.get('/berichte/bahnen/{}'.format(bahnen))
+ self.assertTrue(result.data.startswith(b'<?xml'))
+ root = et.fromstring(result.data)
+ self.assertIn('Rodelbahnberichte', root.find('{http://www.w3.org/2005/Atom}title').text)
+ self.assertEqual(len(root.findall('{http://www.w3.org/2005/Atom}entry')), count, 'bahnen "{}" not found {} times'.format(bahnen, count))
+
def test_region(self):
region_count = {
'tirol': 6,