예제 #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
     )
예제 #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
     )
예제 #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
     )
예제 #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
     )
예제 #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)
     )
예제 #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)
     )