mirror of https://github.com/docker/docker-py.git
Merge pull request #1835 from docker/1758-url-quote-path
Fix URL-quoting for resource names containing spaces
This commit is contained in:
commit
20b5b58bb0
|
@ -206,7 +206,7 @@ class APIClient(
|
|||
'instead'.format(arg, type(arg))
|
||||
)
|
||||
|
||||
quote_f = partial(six.moves.urllib.parse.quote_plus, safe="/:")
|
||||
quote_f = partial(six.moves.urllib.parse.quote, safe="/:")
|
||||
args = map(quote_f, args)
|
||||
|
||||
if kwargs.get('versioned_api', True):
|
||||
|
|
|
@ -484,3 +484,10 @@ class TestNetworks(BaseAPIIntegrationTest):
|
|||
assert self.client.inspect_network(net_name_swarm, scope='swarm')
|
||||
with pytest.raises(docker.errors.NotFound):
|
||||
self.client.inspect_network(net_name_swarm, scope='local')
|
||||
|
||||
@requires_api_version('1.21')
|
||||
def test_create_remove_network_with_space_in_name(self):
|
||||
net_id = self.client.create_network('test 01')
|
||||
self.tmp_networks.append(net_id)
|
||||
assert self.client.inspect_network('test 01')
|
||||
assert self.client.remove_network('test 01') is None # does not raise
|
||||
|
|
Loading…
Reference in New Issue