MCPcopy
hub / github.com/hugapi/hug / test_doesnt_require

Method test_doesnt_require

tests/test_routing.py:204–212  ·  view source on GitHub ↗

Ensure requirements can be selectively removed on the fly

(self)

Source from the content-addressed store, hash-verified

202 assert self.route.requires(("values",)).route["requires"] == ("love", "values")
203
204 def test_doesnt_require(self):
205 """Ensure requirements can be selectively removed on the fly"""
206 assert self.route.doesnt_require("love").route.get("requires", ()) == ()
207 assert self.route.doesnt_require("values").route["requires"] == ("love",)
208
209 route = self.route.requires(("values",))
210 assert route.doesnt_require("love").route["requires"] == ("values",)
211 assert route.doesnt_require("values").route["requires"] == ("love",)
212 assert route.doesnt_require(("values", "love")).route.get("requires", ()) == ()
213
214 def test_parameters(self):
215 """Test to ensure the parameters can be replaced on the fly"""

Callers

nothing calls this directly

Calls 3

doesnt_requireMethod · 0.80
requiresMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected