MCPcopy Create free account
hub / github.com/python-hyper/uritemplate / make_test

Method make_test

tests/test_uritemplate.py:381–392  ·  view source on GitHub ↗
(
            d: t.Dict[str, ExampleWithVariables],
        )

Source from the content-addressed store, hash-verified

379 cls, name: str, bases: t.Sequence[t.Any], attrs: t.Dict[str, t.Any]
380 ) -> t.Any:
381 def make_test(
382 d: t.Dict[str, ExampleWithVariables],
383 ) -> collections.abc.Callable[["unittest.TestCase"], None]:
384 def _test_(self: "unittest.TestCase") -> None:
385 for k, v in d.items():
386 with self.subTest(template=k, **v):
387 t = URITemplate(k)
388 self.assertEqual(
389 t.expand(v["expansion"]), v["expected"]
390 )
391
392 return _test_
393
394 examples = [
395 (n, getattr(RFCTemplateExamples, n))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected