Ejemplo n.º 1
0
 def test_Percent(self, detail):
     p = Percent()
     with pytest.raises(ValueError) as e:
         p.validate(10, detail)
     assert str(e).endswith("ValueError") == (not detail)
Ejemplo n.º 2
0
 def test_Percent(self):
     p = Percent()
     with pytest.raises(ValueError) as e:
         p.validate(10)
     assert not str(e).endswith("ValueError")
Ejemplo n.º 3
0
 def test_Percent(self, detail) -> None:
     p = Percent()
     with pytest.raises(ValueError) as e:
         p.validate(10, detail)
     assert (str(e.value) == "") == (not detail)
Ejemplo n.º 4
0
 def test_Percent(self) -> None:
     p = Percent()
     with pytest.raises(ValueError) as e:
         p.validate(10)
     assert matches(str(e.value), r"expected a value in range \[0, 1\], got 10")
Ejemplo n.º 5
0
 def test_Percent(self, detail):
     p = Percent()
     with pytest.raises(ValueError) as e:
         p.validate(10, detail)
     assert str(e).endswith("ValueError") == (not detail)
Ejemplo n.º 6
0
 def test_Percent(self):
     p = Percent()
     with pytest.raises(ValueError) as e:
         p.validate(10)
     assert not str(e).endswith("ValueError")