def test_url_format_path_(self): self.assertEqual( _format_url(host="test.com", root="restconf", data_store=None, path="foo/bar", ssl=True), "https://test.com/restconf/foo/bar", )
def test_url_format(self): self.assertEqual( _format_url( host="test.com", root="restconf", data_store="data", path="foo/bar", ), "https://test.com/restconf/data/foo/bar", )
def test_url_format_http_no_path(self): self.assertEqual( _format_url( host="test.com", root="restconf", data_store="data", path=None, ssl=False, ), "http://test.com/restconf/data", )
def test_url_format_path_(self): self.assertEqual(_format_url(host=self.test_host, resource_type=None, path='foo/bar', ssl=True), 'https://test.com/api/foo/bar')
def test_url_format_http_no_path(self): self.assertEqual(_format_url(host=self.test_host, resource_type=ResourceType.OPERATION, path=None, ssl=False), 'http://test.com/api/operation')
def test_url_format_base(self): self.assertEqual(_format_url(host=self.test_host, resource_type=None, path=None, ssl=True), 'https://test.com/api')
def test_url_format_http(self): self.assertEqual(_format_url(host=self.test_host, resource_type=ResourceType.OPERATION, path='foo/bar', ssl=False), 'http://test.com/api/operation/foo/bar')
def test_url_format_path_(self): self.assertEqual( _format_url(host=self.test_host, resource_type=None, path='foo/bar', ssl=True), 'https://test.com/api/foo/bar')
def test_url_format_base(self): self.assertEqual( _format_url(host=self.test_host, resource_type=None, path=None, ssl=True), 'https://test.com/api')
def test_url_format_http_no_path(self): self.assertEqual( _format_url(host=self.test_host, resource_type=ResourceType.OPERATION, path=None, ssl=False), 'http://test.com/api/operation')
def test_url_format_http(self): self.assertEqual( _format_url(host=self.test_host, resource_type=ResourceType.OPERATION, path='foo/bar', ssl=False), 'http://test.com/api/operation/foo/bar')