Merge pull request #2712 from jzvelc/fix_v2_service_extend

Fix `extends` when using v2 config format
This commit is contained in:
Aanand Prasad 2016-01-21 17:06:21 +00:00
commit 7a4fdfd034
2 changed files with 32 additions and 4 deletions

View file

@ -1937,6 +1937,30 @@ class ExtendsTest(unittest.TestCase):
load_from_filename(str(tmpdir.join('docker-compose.yml')))
assert 'Version mismatch' in exc.exconly()
def test_extends_with_defined_version_passes(self):
tmpdir = py.test.ensuretemp('test_extends_with_defined_version')
self.addCleanup(tmpdir.remove)
tmpdir.join('docker-compose.yml').write("""
version: 2
services:
web:
extends:
file: base.yml
service: base
image: busybox
""")
tmpdir.join('base.yml').write("""
version: 2
services:
base:
volumes: ['/foo']
ports: ['3000:3000']
command: top
""")
service = load_from_filename(str(tmpdir.join('docker-compose.yml')))
self.assertEquals(service[0]['command'], "top")
@pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason='paths use slash')
class ExpandPathTest(unittest.TestCase):