def test_negative_limit_raises(self): with self.assertRaises(BadRequest): check_limit(-1)
def test_limit_returns_set_max_if_give_limit_is_exceeded(self): limit = check_limit(1500) self.assertEqual(limit, 1000)
def test_limit_of_zero_returns_default(self): limit = check_limit(0) self.assertEqual(limit, 100)
def test_maximum_limit_return_val(self): limit = check_limit(300) self.assertEqual(limit, 300)
def test_maximum_limit_returns_configured_if_limit_above_conf(self): limit = check_limit(350) self.assertEqual(limit, 320)
def test_negative_limit_raises(self): with pytest.raises(BadRequest): check_limit(-1)
def test_limit_of_zero_returns_default(self): limit = check_limit(0) assert limit == 100
def test_limit_returns_set_max_if_give_limit_is_exceeded(self): limit = check_limit(1500) assert limit == 1000
def test_maximum_limit_returns_configured_if_limit_above_conf(self): limit = check_limit(350) assert limit == 320
def test_maximum_limit_return_val(self): limit = check_limit(300) assert limit == 300