コード例 #1
0
 def test_format_url_full_url(self):
     client = PipelineClientBase("https://bing.com/path")
     formatted = client.format_url("https://google.com/subpath/{foo}", foo="bar")
     assert formatted == "https://google.com/subpath/bar"
コード例 #2
0
 def test_format_url_no_base_url(self):
     client = PipelineClientBase(None)
     formatted = client.format_url("https://google.com/subpath/{foo}", foo="bar")
     assert formatted == "https://google.com/subpath/bar"
コード例 #3
0
 def test_format_url_extra_path_missing_values_with_query(self):
     client = PipelineClientBase("https://bing.com/path?query=testvalue&x=2ndvalue")
     formatted = client.format_url("/subpath/{foo}")
     assert formatted == "https://bing.com/path/subpath?query=testvalue&x=2ndvalue"
コード例 #4
0
 def test_format_url_extra_path_missing_values(self):
     client = PipelineClientBase("https://bing.com/path")
     formatted = client.format_url("/subpath/{foo}")
     assert formatted == "https://bing.com/path/subpath"
コード例 #5
0
 def test_format_url_complex_params(self):
     client = PipelineClientBase("https://bing.com/path")
     formatted = client.format_url("/subpath/{a}/{b}/foo/{c}/bar", a="X", c="Y")
     assert formatted == "https://bing.com/path/subpath/X/foo/Y/bar"
コード例 #6
0
 def test_format_url_with_query(self):
     client = PipelineClientBase("https://bing.com/path?query=testvalue&x=2ndvalue")
     formatted = client.format_url("/{foo}", foo="bar")
     assert formatted == "https://bing.com/path/bar?query=testvalue&x=2ndvalue"
コード例 #7
0
 def test_format_url_basic(self):
     client = PipelineClientBase("https://bing.com")
     formatted = client.format_url("/{foo}", foo="bar")
     assert formatted == "https://bing.com/bar"