예제 #1
0
 def test_negative_limit_raises(self):
     with self.assertRaises(BadRequest):
         check_limit(-1)
예제 #2
0
 def test_limit_returns_set_max_if_give_limit_is_exceeded(self):
     limit = check_limit(1500)
     self.assertEqual(limit, 1000)
예제 #3
0
 def test_limit_of_zero_returns_default(self):
     limit = check_limit(0)
     self.assertEqual(limit, 100)
예제 #4
0
 def test_maximum_limit_return_val(self):
     limit = check_limit(300)
     self.assertEqual(limit, 300)
예제 #5
0
 def test_maximum_limit_returns_configured_if_limit_above_conf(self):
     limit = check_limit(350)
     self.assertEqual(limit, 320)
예제 #6
0
 def test_negative_limit_raises(self):
     with pytest.raises(BadRequest):
         check_limit(-1)
예제 #7
0
 def test_limit_of_zero_returns_default(self):
     limit = check_limit(0)
     assert limit == 100
예제 #8
0
 def test_limit_returns_set_max_if_give_limit_is_exceeded(self):
     limit = check_limit(1500)
     assert limit == 1000
예제 #9
0
 def test_maximum_limit_returns_configured_if_limit_above_conf(self):
     limit = check_limit(350)
     assert limit == 320
예제 #10
0
 def test_maximum_limit_return_val(self):
     limit = check_limit(300)
     assert limit == 300