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"
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"
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"
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"
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"
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"
def test_format_url_basic(self): client = PipelineClientBase("https://bing.com") formatted = client.format_url("/{foo}", foo="bar") assert formatted == "https://bing.com/bar"