コード例 #1
0
ファイル: test_conditions.py プロジェクト: YPlan/gargoyle
 def test_clean_fail_empty(self):
     condition = Percent()
     with pytest.raises(ValidationError):
         condition.clean('')
コード例 #2
0
ファイル: test_conditions.py プロジェクト: YPlan/gargoyle
 def test_clean_success(self):
     condition = Percent()
     assert condition.clean('0-50') == '0-50'
コード例 #3
0
ファイル: test_conditions.py プロジェクト: YPlan/gargoyle
 def test_clean_fail_no_numbers(self):
     condition = Percent()
     with pytest.raises(ValidationError):
         condition.clean('-')
コード例 #4
0
ファイル: test_conditions.py プロジェクト: YPlan/gargoyle
 def test_clean_fail_out_of_range(self):
     condition = Percent()
     with pytest.raises(ValidationError):
         condition.clean('10-160')
コード例 #5
0
ファイル: test_conditions.py プロジェクト: YPlan/gargoyle
 def test_clean_first_greater_than_second(self):
     condition = Percent()
     with pytest.raises(ValidationError):
         condition.clean('80-20')
コード例 #6
0
 def test_clean_fail_empty(self):
     condition = Percent()
     with pytest.raises(ValidationError):
         condition.clean('')
コード例 #7
0
 def test_clean_fail_no_numbers(self):
     condition = Percent()
     with pytest.raises(ValidationError):
         condition.clean('-')
コード例 #8
0
 def test_clean_success(self):
     condition = Percent()
     assert condition.clean('0-50') == '0-50'
コード例 #9
0
 def test_clean_first_greater_than_second(self):
     condition = Percent()
     with pytest.raises(ValidationError):
         condition.clean('80-20')
コード例 #10
0
 def test_clean_fail_out_of_range(self):
     condition = Percent()
     with pytest.raises(ValidationError):
         condition.clean('10-160')