Exemplo 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)
Exemplo n.º 2
0
 def test_Percent(self):
     p = Percent()
     with pytest.raises(ValueError) as e:
         p.validate(10)
     assert not str(e).endswith("ValueError")
Exemplo 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)
Exemplo 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")
Exemplo 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)
Exemplo n.º 6
0
 def test_Percent(self):
     p = Percent()
     with pytest.raises(ValueError) as e:
         p.validate(10)
     assert not str(e).endswith("ValueError")