MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / testHostnameHasDomain

Method testHostnameHasDomain

tests/Requester.py:268–282  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

266 )
267
268 def testHostnameHasDomain(self):
269 assert self.g.requester.__hostnameHasDomain("github.com", "github.com")
270 assert self.g.requester.__hostnameHasDomain("api.github.com", "github.com")
271 assert self.g.requester.__hostnameHasDomain("api.github.com", "github.com")
272 assert self.g.requester.__hostnameHasDomain("ghe.local", "ghe.local")
273 assert self.g.requester.__hostnameHasDomain("api.ghe.local", "ghe.local")
274 assert self.g.requester.__hostnameHasDomain("api.prod.ghe.local", "prod.ghe.local")
275 assert self.g.requester.__hostnameHasDomain("github.com", ["github.com", "githubusercontent.com"])
276 assert self.g.requester.__hostnameHasDomain("api.github.com", ["github.com", "githubusercontent.com"])
277 assert self.g.requester.__hostnameHasDomain("githubusercontent.com", ["github.com", "githubusercontent.com"])
278 assert self.g.requester.__hostnameHasDomain(
279 "objects.githubusercontent.com", ["github.com", "githubusercontent.com"]
280 )
281 assert self.g.requester.__hostnameHasDomain("maliciousgithub.com", "github.com") is False
282 assert self.g.requester.__hostnameHasDomain("abc.def", ["github.com", "githubusercontent.com"]) is False
283
284 def testAssertUrlAllowed(self):
285 # default github.com requester

Callers

nothing calls this directly

Calls 1

__hostnameHasDomainMethod · 0.80

Tested by

no test coverage detected