Beispiel #1
0
 def test_invalid_region(self):
     with self.assertRaises(exceptions.QueryError):
         rankings.get_rankings(year=2016,
                               region='japan',
                               gender='M',
                               age_group='U20',
                               event='400')
Beispiel #2
0
 def test_all_search_fields_filled(self):
     ranks = rankings.get_rankings(year=2016,
                                   gender='M',
                                   age_group='U20',
                                   event='400',
                                   region='london')
     self.assertEqual(len(ranks), 64)
Beispiel #3
0
 def test_empty_search(self):
     with self.assertRaises(TypeError):
         rankings.get_rankings()
Beispiel #4
0
 def test_invalid_event(self):
     ranks = rankings.get_rankings(year=2016,
                                   gender='M',
                                   age_group='U20',
                                   event='123')
     self.assertEqual(ranks, [])
Beispiel #5
0
 def test_invalid_age_group(self):
     ranks = rankings.get_rankings(year=2016,
                                   gender='M',
                                   age_group='U99',
                                   event='400')
     self.assertEqual(ranks, [])
Beispiel #6
0
 def test_invalid_year(self):
     ranks = rankings.get_rankings(year='gsgs',
                                   gender='M',
                                   age_group='U20',
                                   event='400')
     self.assertEqual(ranks, [])
Beispiel #7
0
 def test_future_year(self):
     ranks = rankings.get_rankings(year=2030,
                                   gender='M',
                                   age_group='U20',
                                   event='400')
     self.assertEqual(ranks, [])
Beispiel #8
0
 def test_year_gender_age_group(self):
     with self.assertRaises(TypeError):
         rankings.get_rankings(year=2016, gender='M', age_group='U20')
Beispiel #9
0
 def test_all_fields_but_region(self):
     ranks = rankings.get_rankings(year=2016,
                                   gender='M',
                                   age_group='U20',
                                   event='400')
     self.assertEqual(len(ranks), 427)