def test_Size(self):
     p = Size()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert matches(
         str(e.value),
         r"expected a value of type Real, got junk of type (str|unicode)")
Exemple #2
0
 def test_Size(self, detail):
     p = Size()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert str(e).endswith("ValueError") == (not detail)
Exemple #3
0
 def test_Size(self):
     p = Size()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert not str(e).endswith("ValueError")
 def test_Size(self, detail) -> None:
     p = Size()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert (str(e.value) == "") == (not detail)
Exemple #5
0
 def test_Size(self, detail):
     p = Size()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert str(e).endswith("ValueError") == (not detail)
Exemple #6
0
 def test_Size(self):
     p = Size()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert not str(e).endswith("ValueError")