mirror of https://github.com/docker/docker-py.git
flake8 fixes
Additionally this change should make moving to /v1.8 slightly less painful
This commit is contained in:
parent
89922efbac
commit
cf946ff27b
125
tests/test.py
125
tests/test.py
|
@ -55,6 +55,7 @@ def fake_resp(url, data=None, **kwargs):
|
|||
return response(status_code=status_code, content=content)
|
||||
|
||||
fake_request = mock.Mock(side_effect=fake_resp)
|
||||
url_prefix = 'http+unix://var/run/docker.sock/v1.6/'
|
||||
|
||||
|
||||
@mock.patch.multiple('docker.Client', get=fake_request, post=fake_request,
|
||||
|
@ -75,7 +76,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/version',
|
||||
url_prefix + 'version',
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
||||
|
@ -86,7 +87,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/info',
|
||||
url_prefix + 'info',
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
||||
|
@ -97,7 +98,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/search',
|
||||
url_prefix + 'images/search',
|
||||
params={'term': 'busybox'},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -112,7 +113,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
except Exception as e:
|
||||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/json',
|
||||
url_prefix + 'images/json',
|
||||
params={'filter': None, 'only_ids': 0, 'all': 1},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -123,7 +124,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
except Exception as e:
|
||||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/json',
|
||||
url_prefix + 'images/json',
|
||||
params={'filter': None, 'only_ids': 1, 'all': 1},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -135,7 +136,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/json',
|
||||
url_prefix + 'images/json',
|
||||
params={'filter': None, 'only_ids': 1, 'all': 0},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -147,7 +148,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/json',
|
||||
url_prefix + 'containers/json',
|
||||
params={
|
||||
'all': 1,
|
||||
'since': None,
|
||||
|
@ -170,7 +171,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
|
||||
args = fake_request.call_args
|
||||
self.assertEqual(args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/create')
|
||||
url_prefix + 'containers/create')
|
||||
self.assertEqual(json.loads(args[1]['data']),
|
||||
json.loads('''
|
||||
{"Tty": false, "Image": "busybox", "Cmd": ["true"],
|
||||
|
@ -192,7 +193,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
|
||||
args = fake_request.call_args
|
||||
self.assertEqual(args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/create')
|
||||
url_prefix + 'containers/create')
|
||||
self.assertEqual(json.loads(args[1]['data']),
|
||||
json.loads('''
|
||||
{"Tty": false, "Image": "busybox",
|
||||
|
@ -213,7 +214,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
|
||||
args = fake_request.call_args
|
||||
self.assertEqual(args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/create')
|
||||
url_prefix + 'containers/create')
|
||||
self.assertEqual(json.loads(args[1]['data']),
|
||||
json.loads('''
|
||||
{"Tty": false, "Image": "busybox",
|
||||
|
@ -238,7 +239,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
|
||||
args = fake_request.call_args
|
||||
self.assertEqual(args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/create')
|
||||
url_prefix + 'containers/create')
|
||||
self.assertEqual(json.loads(args[1]['data']),
|
||||
json.loads('''
|
||||
{"Tty": false, "Image": "busybox",
|
||||
|
@ -260,7 +261,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
|
||||
args = fake_request.call_args
|
||||
self.assertEqual(args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/create')
|
||||
url_prefix + 'containers/create')
|
||||
self.assertEqual(json.loads(args[1]['data']),
|
||||
json.loads('''
|
||||
{"Tty": false, "Image": "busybox",
|
||||
|
@ -282,7 +283,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
|
||||
args = fake_request.call_args
|
||||
self.assertEqual(args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/create')
|
||||
url_prefix + 'containers/create')
|
||||
self.assertEqual(json.loads(args[1]['data']),
|
||||
json.loads('''
|
||||
{"Tty": false, "Image": "busybox",
|
||||
|
@ -304,7 +305,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
|
||||
args = fake_request.call_args
|
||||
self.assertEqual(args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/create')
|
||||
url_prefix + 'containers/create')
|
||||
self.assertEqual(json.loads(args[1]['data']),
|
||||
json.loads('''
|
||||
{"Tty": false, "Image": "busybox", "Cmd": ["true"],
|
||||
|
@ -324,7 +325,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
args = fake_request.call_args
|
||||
self.assertEqual(
|
||||
args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/start'
|
||||
url_prefix + 'containers/3cc2351ab11b/start'
|
||||
)
|
||||
self.assertEqual(
|
||||
json.loads(args[1]['data']),
|
||||
|
@ -350,7 +351,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
args = fake_request.call_args
|
||||
self.assertEqual(
|
||||
args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/start'
|
||||
url_prefix + 'containers/3cc2351ab11b/start'
|
||||
)
|
||||
self.assertEqual(
|
||||
json.loads(args[1]['data']),
|
||||
|
@ -376,8 +377,8 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
args = fake_request.call_args
|
||||
self.assertEqual(args[0][0], 'http+unix://var/run/docker.sock/v1.6/'
|
||||
'containers/3cc2351ab11b/start')
|
||||
self.assertEqual(args[0][0], url_prefix +
|
||||
'containers/3cc2351ab11b/start')
|
||||
self.assertEqual(
|
||||
json.loads(args[1]['data']),
|
||||
{
|
||||
|
@ -403,8 +404,8 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
args = fake_request.call_args
|
||||
self.assertEqual(args[0][0], 'http+unix://var/run/docker.sock/v1.6/'
|
||||
'containers/3cc2351ab11b/start')
|
||||
self.assertEqual(args[0][0], url_prefix +
|
||||
'containers/3cc2351ab11b/start')
|
||||
self.assertEqual(json.loads(args[1]['data']),
|
||||
{"Binds": ["/tmp:/mnt"],
|
||||
"PublishAllPorts": False,
|
||||
|
@ -431,8 +432,8 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
args = fake_request.call_args
|
||||
self.assertEqual(args[0][0], 'http+unix://var/run/docker.sock/v1.6/'
|
||||
'containers/3cc2351ab11b/start')
|
||||
self.assertEqual(args[0][0], url_prefix +
|
||||
'containers/3cc2351ab11b/start')
|
||||
data = json.loads(args[1]['data'])
|
||||
self.assertEqual(data['PublishAllPorts'], False)
|
||||
self.assertTrue('1111/tcp' in data['PortBindings'])
|
||||
|
@ -482,7 +483,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
args = fake_request.call_args
|
||||
self.assertEqual(
|
||||
args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/start'
|
||||
url_prefix + 'containers/3cc2351ab11b/start'
|
||||
)
|
||||
self.assertEqual(
|
||||
json.loads(args[1]['data']),
|
||||
|
@ -511,7 +512,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
args = fake_request.call_args
|
||||
self.assertEqual(
|
||||
args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/start'
|
||||
url_prefix + 'containers/3cc2351ab11b/start'
|
||||
)
|
||||
self.assertEqual(
|
||||
json.loads(args[1]['data']),
|
||||
|
@ -535,7 +536,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
args = fake_request.call_args
|
||||
self.assertEqual(
|
||||
args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/start'
|
||||
url_prefix + 'containers/3cc2351ab11b/start'
|
||||
)
|
||||
self.assertEqual(json.loads(args[1]['data']),
|
||||
{"PublishAllPorts": False, "Privileged": True})
|
||||
|
@ -554,7 +555,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
args = fake_request.call_args
|
||||
self.assertEqual(
|
||||
args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/start'
|
||||
url_prefix + 'containers/3cc2351ab11b/start'
|
||||
)
|
||||
self.assertEqual(
|
||||
json.loads(args[1]['data']),
|
||||
|
@ -576,7 +577,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/wait',
|
||||
url_prefix + 'containers/3cc2351ab11b/wait',
|
||||
timeout=None
|
||||
)
|
||||
|
||||
|
@ -588,7 +589,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/wait',
|
||||
url_prefix + 'containers/3cc2351ab11b/wait',
|
||||
timeout=None
|
||||
)
|
||||
|
||||
|
@ -624,7 +625,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/attach',
|
||||
url_prefix + 'containers/3cc2351ab11b/attach',
|
||||
params={'stream': 0, 'logs': 1, 'stderr': 1, 'stdout': 1},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS,
|
||||
stream=False
|
||||
|
@ -637,7 +638,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/attach',
|
||||
url_prefix + 'containers/3cc2351ab11b/attach',
|
||||
params={'stream': 0, 'logs': 1, 'stderr': 1, 'stdout': 1},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS,
|
||||
stream=False
|
||||
|
@ -650,7 +651,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/attach',
|
||||
url_prefix + 'containers/3cc2351ab11b/attach',
|
||||
params={'stream': 1, 'logs': 1, 'stderr': 1, 'stdout': 1},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS,
|
||||
stream=True
|
||||
|
@ -663,7 +664,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/changes',
|
||||
url_prefix + 'containers/3cc2351ab11b/changes',
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
||||
|
@ -674,7 +675,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/changes',
|
||||
url_prefix + 'containers/3cc2351ab11b/changes',
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
||||
|
@ -685,7 +686,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/json',
|
||||
url_prefix + 'containers/3cc2351ab11b/json',
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
||||
|
@ -696,7 +697,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/stop',
|
||||
url_prefix + 'containers/3cc2351ab11b/stop',
|
||||
params={'t': 2},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -708,7 +709,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/stop',
|
||||
url_prefix + 'containers/3cc2351ab11b/stop',
|
||||
params={'t': 2},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -720,7 +721,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/kill',
|
||||
url_prefix + 'containers/3cc2351ab11b/kill',
|
||||
params={},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -732,7 +733,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/kill',
|
||||
url_prefix + 'containers/3cc2351ab11b/kill',
|
||||
params={},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -744,7 +745,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/kill',
|
||||
url_prefix + 'containers/3cc2351ab11b/kill',
|
||||
params={'signal': signal.SIGTERM},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -756,7 +757,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception : {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/restart',
|
||||
url_prefix + 'containers/3cc2351ab11b/restart',
|
||||
params={'t': 2},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -768,7 +769,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/restart',
|
||||
url_prefix + 'containers/3cc2351ab11b/restart',
|
||||
params={'t': 2},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -780,7 +781,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b',
|
||||
url_prefix + 'containers/3cc2351ab11b',
|
||||
params={'v': False, 'link': False},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -792,7 +793,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b',
|
||||
url_prefix + 'containers/3cc2351ab11b',
|
||||
params={'v': False, 'link': False},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -804,7 +805,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b',
|
||||
url_prefix + 'containers/3cc2351ab11b',
|
||||
params={'v': False, 'link': True},
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -816,7 +817,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/export',
|
||||
url_prefix + 'containers/3cc2351ab11b/export',
|
||||
stream=True,
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -828,7 +829,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/export',
|
||||
url_prefix + 'containers/3cc2351ab11b/export',
|
||||
stream=True,
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
@ -840,7 +841,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/containers/3cc2351ab11b/json',
|
||||
url_prefix + 'containers/3cc2351ab11b/json',
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
||||
|
@ -857,7 +858,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
args = fake_request.call_args
|
||||
self.assertEqual(
|
||||
args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/images/create'
|
||||
url_prefix + 'images/create'
|
||||
)
|
||||
self.assertEqual(
|
||||
args[1]['params'],
|
||||
|
@ -874,7 +875,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
args = fake_request.call_args
|
||||
self.assertEqual(
|
||||
args[0][0],
|
||||
'http+unix://var/run/docker.sock/v1.6/images/create'
|
||||
url_prefix + 'images/create'
|
||||
)
|
||||
self.assertEqual(
|
||||
args[1]['params'],
|
||||
|
@ -889,7 +890,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/commit',
|
||||
url_prefix + 'commit',
|
||||
data='{}',
|
||||
headers={'Content-Type': 'application/json'},
|
||||
params={
|
||||
|
@ -909,7 +910,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/e9aa60c60128',
|
||||
url_prefix + 'images/e9aa60c60128',
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
||||
|
@ -920,7 +921,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/test_image/history',
|
||||
url_prefix + 'images/test_image/history',
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
||||
|
@ -935,7 +936,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/create',
|
||||
url_prefix + 'images/create',
|
||||
params={
|
||||
'repo': fake_api.FAKE_REPO_NAME,
|
||||
'tag': fake_api.FAKE_TAG_NAME,
|
||||
|
@ -958,7 +959,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/create',
|
||||
url_prefix + 'images/create',
|
||||
params={
|
||||
'repo': fake_api.FAKE_REPO_NAME,
|
||||
'tag': fake_api.FAKE_TAG_NAME,
|
||||
|
@ -981,7 +982,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/create',
|
||||
url_prefix + 'images/create',
|
||||
params={
|
||||
'repo': fake_api.FAKE_REPO_NAME,
|
||||
'tag': fake_api.FAKE_TAG_NAME,
|
||||
|
@ -998,7 +999,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/test_image/json',
|
||||
url_prefix + 'images/test_image/json',
|
||||
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
||||
|
@ -1010,7 +1011,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/test_image/insert',
|
||||
url_prefix + 'images/test_image/insert',
|
||||
params={
|
||||
'url': fake_api.FAKE_URL,
|
||||
'path': fake_api.FAKE_PATH
|
||||
|
@ -1025,7 +1026,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/test_image/push',
|
||||
url_prefix + 'images/test_image/push',
|
||||
data='{}',
|
||||
headers={'Content-Type': 'application/json'},
|
||||
stream=False,
|
||||
|
@ -1039,7 +1040,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/test_image/push',
|
||||
url_prefix + 'images/test_image/push',
|
||||
data='{}',
|
||||
headers={'Content-Type': 'application/json'},
|
||||
stream=True,
|
||||
|
@ -1053,7 +1054,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/e9aa60c60128/tag',
|
||||
url_prefix + 'images/e9aa60c60128/tag',
|
||||
params={
|
||||
'tag': None,
|
||||
'repo': 'repo',
|
||||
|
@ -1073,7 +1074,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/e9aa60c60128/tag',
|
||||
url_prefix + 'images/e9aa60c60128/tag',
|
||||
params={
|
||||
'tag': 'tag',
|
||||
'repo': 'repo',
|
||||
|
@ -1090,7 +1091,7 @@ class DockerClientTest(unittest.TestCase):
|
|||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
fake_request.assert_called_with(
|
||||
'http+unix://var/run/docker.sock/v1.6/images/e9aa60c60128/tag',
|
||||
url_prefix + 'images/e9aa60c60128/tag',
|
||||
params={
|
||||
'tag': None,
|
||||
'repo': 'repo',
|
||||
|
|
Loading…
Reference in New Issue