mirror of https://github.com/docker/compose.git
tests.unit.config: Make sure volume order is preserved.
Signed-off-by: Antony MECHIN <antony.mechin@docker.com>
This commit is contained in:
parent
879f7cb1ed
commit
bbcfce4029
|
@ -8,6 +8,7 @@ import os
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
|
from random import shuffle
|
||||||
|
|
||||||
import py
|
import py
|
||||||
import pytest
|
import pytest
|
||||||
|
@ -3536,6 +3537,13 @@ class VolumeConfigTest(unittest.TestCase):
|
||||||
).services[0]
|
).services[0]
|
||||||
assert d['volumes'] == [VolumeSpec.parse('/host/path:/container/path')]
|
assert d['volumes'] == [VolumeSpec.parse('/host/path:/container/path')]
|
||||||
|
|
||||||
|
@pytest.mark.skipif(IS_WINDOWS_PLATFORM, reason='posix paths')
|
||||||
|
def test_volumes_order_is_preserved(self):
|
||||||
|
volumes = ['/{0}:/{0}'.format(i) for i in range(0, 6)]
|
||||||
|
shuffle(volumes)
|
||||||
|
cfg = make_service_dict('foo', {'build': '.', 'volumes': volumes})
|
||||||
|
assert cfg['volumes'] == volumes
|
||||||
|
|
||||||
@pytest.mark.skipif(IS_WINDOWS_PLATFORM, reason='posix paths')
|
@pytest.mark.skipif(IS_WINDOWS_PLATFORM, reason='posix paths')
|
||||||
@mock.patch.dict(os.environ)
|
@mock.patch.dict(os.environ)
|
||||||
def test_volume_binding_with_home(self):
|
def test_volume_binding_with_home(self):
|
||||||
|
|
Loading…
Reference in New Issue