MCPcopy Index your code
hub / github.com/googleapis/google-api-python-client / test_urljoin

Method test_urljoin

tests/test_discovery.py:437–452  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

435 self.assertEqual(result, "https://www.example.com/upload/foo")
436
437 def test_urljoin(self):
438 # We want to exhaustively test various URL combinations.
439 simple_bases = ["https://www.googleapis.com", "https://www.googleapis.com/"]
440 long_urls = ["foo/v1/bar:custom?alt=json", "/foo/v1/bar:custom?alt=json"]
441
442 long_bases = [
443 "https://www.googleapis.com/foo/v1",
444 "https://www.googleapis.com/foo/v1/",
445 ]
446 simple_urls = ["bar:custom?alt=json", "/bar:custom?alt=json"]
447
448 final_url = "https://www.googleapis.com/foo/v1/bar:custom?alt=json"
449 for base, url in itertools.product(simple_bases, long_urls):
450 self.assertEqual(final_url, _urljoin(base, url))
451 for base, url in itertools.product(long_bases, simple_urls):
452 self.assertEqual(final_url, _urljoin(base, url))
453
454 def test_ResourceMethodParameters_zoo_get(self):
455 parameters = ResourceMethodParameters(self.zoo_get_method_desc)

Callers

nothing calls this directly

Calls 1

_urljoinFunction · 0.90

Tested by

no test coverage detected