Beispiel #1
0
 def test_process_limit_lower_than_zero(self):
     with pytest.raises(ValueError) as ex:
         utils.process_limit(1, None, -3)
     assert 'can not be < 0' in str(ex.value)
     with pytest.raises(ValueError) as ex:
         utils.process_limit(-1, None, 3)
     assert 'can not be < 0' in str(ex.value)
Beispiel #2
0
 def test_process_limit_lower_than_zero(self):
     with pytest.raises(ValueError) as ex:
         utils.process_limit(1, None, -3)
     assert 'can not be < 0' in str(ex.value)
     with pytest.raises(ValueError) as ex:
         utils.process_limit(-1, None, 3)
     assert 'can not be < 0' in str(ex.value)
Beispiel #3
0
 def test_process_limit_no_start_page(self):
     start, limit = utils.process_limit(start=None, page=None, limit=5)
     assert start == 0
     assert limit == 5
Beispiel #4
0
 def test_process_limit_start(self):
     start, limit = utils.process_limit(start=1, page=None, limit=5)
     assert start == 1
     assert limit == 5
Beispiel #5
0
 def test_process_limit_start_and_page(self):
     with pytest.raises(ValueError) as ex:
         utils.process_limit(1, 2, 3)
     assert 'at the same time' in str(ex.value)
Beispiel #6
0
 def test_process_limit_no_start_page(self):
     start, limit = utils.process_limit(start=None, page=None, limit=5)
     assert start == 0
     assert limit == 5
Beispiel #7
0
 def test_process_limit_start(self):
     start, limit = utils.process_limit(start=1, page=None, limit=5)
     assert start == 1
     assert limit == 5
Beispiel #8
0
 def test_process_limit_start_and_page(self):
     with pytest.raises(ValueError) as ex:
         utils.process_limit(1, 2, 3)
     assert 'at the same time' in str(ex.value)