mirror of https://github.com/docker/compose.git
Update service volume tests to use mounts key
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
3bdcc9d954
commit
afab5c76ea
|
@ -600,12 +600,33 @@ class ServiceVolumesTest(unittest.TestCase):
|
|||
}
|
||||
container = Container(self.mock_client, {
|
||||
'Image': 'ababab',
|
||||
'Volumes': {
|
||||
'/host/volume': '/host/volume',
|
||||
'/existing/volume': '/var/lib/docker/aaaaaaaa',
|
||||
'/removed/volume': '/var/lib/docker/bbbbbbbb',
|
||||
'/mnt/image/data': '/var/lib/docker/cccccccc',
|
||||
},
|
||||
'Mounts': [
|
||||
{
|
||||
'Source': '/host/volume',
|
||||
'Destination': '/host/volume',
|
||||
'Mode': '',
|
||||
'RW': True,
|
||||
'Name': 'hostvolume',
|
||||
}, {
|
||||
'Source': '/var/lib/docker/aaaaaaaa',
|
||||
'Destination': '/existing/volume',
|
||||
'Mode': '',
|
||||
'RW': True,
|
||||
'Name': 'existingvolume',
|
||||
}, {
|
||||
'Source': '/var/lib/docker/bbbbbbbb',
|
||||
'Destination': '/removed/volume',
|
||||
'Mode': '',
|
||||
'RW': True,
|
||||
'Name': 'removedvolume',
|
||||
}, {
|
||||
'Source': '/var/lib/docker/cccccccc',
|
||||
'Destination': '/mnt/image/data',
|
||||
'Mode': '',
|
||||
'RW': True,
|
||||
'Name': 'imagedata',
|
||||
},
|
||||
]
|
||||
}, has_been_inspected=True)
|
||||
|
||||
expected = [
|
||||
|
@ -630,7 +651,13 @@ class ServiceVolumesTest(unittest.TestCase):
|
|||
|
||||
intermediate_container = Container(self.mock_client, {
|
||||
'Image': 'ababab',
|
||||
'Volumes': {'/existing/volume': '/var/lib/docker/aaaaaaaa'},
|
||||
'Mounts': [{
|
||||
'Source': '/var/lib/docker/aaaaaaaa',
|
||||
'Destination': '/existing/volume',
|
||||
'Mode': '',
|
||||
'RW': True,
|
||||
'Name': 'existingvolume',
|
||||
}],
|
||||
}, has_been_inspected=True)
|
||||
|
||||
expected = [
|
||||
|
@ -693,9 +720,16 @@ class ServiceVolumesTest(unittest.TestCase):
|
|||
self.mock_client.inspect_container.return_value = {
|
||||
'Id': '123123123',
|
||||
'Image': 'ababab',
|
||||
'Volumes': {
|
||||
'/data': '/mnt/sda1/host/path',
|
||||
},
|
||||
'Mounts': [
|
||||
{
|
||||
'Destination': '/data',
|
||||
'Source': '/mnt/sda1/host/path',
|
||||
'Mode': '',
|
||||
'RW': True,
|
||||
'Driver': 'local',
|
||||
'Name': 'abcdefff1234'
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
service._get_container_create_options(
|
||||
|
|
Loading…
Reference in New Issue