コード例 #1
0
ファイル: test_utils.py プロジェクト: timgates42/nefertari
 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)
コード例 #2
0
ファイル: test_utils.py プロジェクト: karthikmm/nefertari
 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)
コード例 #3
0
ファイル: test_utils.py プロジェクト: timgates42/nefertari
 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
コード例 #4
0
ファイル: test_utils.py プロジェクト: timgates42/nefertari
 def test_process_limit_start(self):
     start, limit = utils.process_limit(start=1, page=None, limit=5)
     assert start == 1
     assert limit == 5
コード例 #5
0
ファイル: test_utils.py プロジェクト: timgates42/nefertari
 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)
コード例 #6
0
ファイル: test_utils.py プロジェクト: karthikmm/nefertari
 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
コード例 #7
0
ファイル: test_utils.py プロジェクト: karthikmm/nefertari
 def test_process_limit_start(self):
     start, limit = utils.process_limit(start=1, page=None, limit=5)
     assert start == 1
     assert limit == 5
コード例 #8
0
ファイル: test_utils.py プロジェクト: karthikmm/nefertari
 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)