Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions tests/unit/container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,14 +751,18 @@ def test_create_container_with_port_binds(self):
)

def test_create_container_with_mac_address(self):
mac_address_expected = "02:42:ac:11:00:0a"
expected = "02:42:ac:11:00:0a"

container = self.client.create_container(
'busybox', ['sleep', '60'], mac_address=mac_address_expected)
self.client.create_container(
'busybox',
['sleep', '60'],
mac_address=expected
)

res = self.client.inspect_container(container['Id'])
self.assertEqual(mac_address_expected,
res['NetworkSettings']['MacAddress'])
args = fake_request.call_args
self.assertEqual(args[0][1], url_prefix + 'containers/create')
data = json.loads(args[1]['data'])
assert data['MacAddress'] == expected

def test_create_container_with_links(self):
link_path = 'path'
Expand Down
31 changes: 0 additions & 31 deletions tests/unit/fake_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,35 +169,6 @@ def get_fake_inspect_image():
return status_code, response


def get_fake_port():
status_code = 200
response = {
'HostConfig': {
'Binds': None,
'ContainerIDFile': '',
'Links': None,
'LxcConf': None,
'PortBindings': {
'1111': None,
'1111/tcp': [{'HostIp': '127.0.0.1', 'HostPort': '4567'}],
'2222': None
},
'Privileged': False,
'PublishAllPorts': False
},
'NetworkSettings': {
'Bridge': 'docker0',
'PortMapping': None,
'Ports': {
'1111': None,
'1111/tcp': [{'HostIp': '127.0.0.1', 'HostPort': '4567'}],
'2222': None},
'MacAddress': '02:42:ac:11:00:0a'
}
}
return status_code, response


def get_fake_insert_image():
status_code = 200
response = {'StatusCode': 0}
Expand Down Expand Up @@ -495,8 +466,6 @@ def post_fake_update_container():
post_fake_pause_container,
'{1}/{0}/containers/3cc2351ab11b/unpause'.format(CURRENT_VERSION, prefix):
post_fake_unpause_container,
'{1}/{0}/containers/3cc2351ab11b/json'.format(CURRENT_VERSION, prefix):
get_fake_port,
'{1}/{0}/containers/3cc2351ab11b/restart'.format(CURRENT_VERSION, prefix):
post_fake_restart_container,
'{1}/{0}/containers/3cc2351ab11b'.format(CURRENT_VERSION, prefix):
Expand Down