MCPcopy Create free account
hub / github.com/rthalley/dnspython / test_formatted_error

Method test_formatted_error

tests/test_exceptions.py:42–49  ·  view source on GitHub ↗

Exceptions with explicit format has to respect it.

(self)

Source from the content-addressed store, hash-verified

40 self.assertEqual(ex.__class__.__doc__, str(ex))
41
42 def test_formatted_error(self):
43 """Exceptions with explicit format has to respect it."""
44 params = {"parameter": "value"}
45 try:
46 raise FormatedError(**params)
47 except FormatedError as ex:
48 msg = FormatedError.fmt.format(**params)
49 self.assertEqual(msg, str(ex))
50
51 def test_kwargs_only(self):
52 """Kwargs cannot be combined with args."""

Callers

nothing calls this directly

Calls 1

FormatedErrorClass · 0.85

Tested by

no test coverage detected