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

Method _test

tests/test_from_fixtures.py:51–60  ·  view source on GitHub ↗
(self, testname: str)

Source from the content-addressed store, hash-verified

49 )
50
51 def _test(self, testname: str) -> None:
52 variables, testcases = self._get_test(testname)
53 for template, expected in testcases:
54 expected_templates = expected_set(expected)
55 expanded = uritemplate.expand(template, variables)
56 assert expanded in expected_templates, ( # nosec
57 f"expanded {template!r} with {variables!r} "
58 f"and got {expanded!r} but expected one of "
59 f"{expected_templates!r}"
60 )
61
62
63class TestSpecExamples(FixtureMixin):

Calls 3

_get_testMethod · 0.95
expected_setFunction · 0.85
expandMethod · 0.45

Tested by

no test coverage detected