Пример #1
0
 def test_should_parse_int_correctly(self):
     modifier = SeverityRules._parse_modifier(3)
     assert modifier(None) == 3
Пример #2
0
 def test_should_parse_addition_correctly(self):
     modifier = SeverityRules._parse_modifier("+2")
     assert modifier(1) == 1 + 2
Пример #3
0
 def should_raise_value_error_on_invalid_value(self):
     with pytest.raises(ValueError):
         SeverityRules._parse_modifier("foo")
Пример #4
0
 def test_should_parse_subtraction_correctly(self):
     modifier = SeverityRules._parse_modifier("-2")
     assert modifier(5) == 5 - 2