Beispiel #1
0
 def test_match_rate_returns_general_rate_otherwise(self):
     expect = make_rate(2)
     prates = {'11': make_rate(2)}
     grates = [expect, make_rate(4)]
     self.assertEqual(
         governor.match_rate('12', None, None, prates, grates),
         expect
     )
Beispiel #2
0
 def test_match_rate_gives_preference_to_project_specific(self):
     expect = make_rate(1)
     prates = {'11': expect}
     grates = [make_rate(2), make_rate(4)]
     self.assertEqual(
         governor.match_rate('11', None, None, prates, grates),
         expect
     )
Beispiel #3
0
 def test_match_rate_returns_general_rate_otherwise(self):
     expect = make_rate(2)
     prates = {'11': make_rate(2)}
     grates = [expect, make_rate(4)]
     self.assertEqual(
         governor.match_rate('12', None, None, prates, grates),
         expect
     )
Beispiel #4
0
 def test_match_rate_gives_preference_to_project_specific(self):
     expect = make_rate(1)
     prates = {'11': expect}
     grates = [make_rate(2), make_rate(4)]
     self.assertEqual(
         governor.match_rate('11', None, None, prates, grates),
         expect
     )
Beispiel #5
0
 def test_match_rate_returns_none_when_none_applicable(self):
     prates = {'11': make_rate(2)}
     grates = [make_rate(2, ['GET']), make_rate(1, ['DELETE'])]
     self.assertIsNone(
         governor.match_rate('12', 'PUT', None, prates, grates)
     )
Beispiel #6
0
 def test_match_rate_returns_none_when_none_applicable(self):
     prates = {'11': make_rate(2)}
     grates = [make_rate(2, ['GET']), make_rate(1, ['DELETE'])]
     self.assertIsNone(
         governor.match_rate('12', 'PUT', None, prates, grates)
     )