mirror of https://github.com/docker/compose.git
Merge pull request #4036 from nbarbey/master
Fix TypeError : unorderable types: str() < int()
This commit is contained in:
commit
8d3c8be7d9
|
@ -886,6 +886,8 @@ def merge_service_dicts(base, override, version):
|
|||
|
||||
|
||||
def merge_unique_items_lists(base, override):
|
||||
override = [str(o) for o in override]
|
||||
base = [str(b) for b in base]
|
||||
return sorted(set().union(base, override))
|
||||
|
||||
|
||||
|
|
|
@ -1486,6 +1486,44 @@ class ConfigTest(unittest.TestCase):
|
|||
'extends': {'service': 'foo'}
|
||||
}
|
||||
|
||||
def test_merge_service_dicts_heterogeneous(self):
|
||||
base = {
|
||||
'volumes': ['.:/app'],
|
||||
'ports': ['5432']
|
||||
}
|
||||
override = {
|
||||
'image': 'alpine:edge',
|
||||
'ports': [5432]
|
||||
}
|
||||
actual = config.merge_service_dicts_from_files(
|
||||
base,
|
||||
override,
|
||||
DEFAULT_VERSION)
|
||||
assert actual == {
|
||||
'image': 'alpine:edge',
|
||||
'volumes': ['.:/app'],
|
||||
'ports': ['5432']
|
||||
}
|
||||
|
||||
def test_merge_service_dicts_heterogeneous_2(self):
|
||||
base = {
|
||||
'volumes': ['.:/app'],
|
||||
'ports': [5432]
|
||||
}
|
||||
override = {
|
||||
'image': 'alpine:edge',
|
||||
'ports': ['5432']
|
||||
}
|
||||
actual = config.merge_service_dicts_from_files(
|
||||
base,
|
||||
override,
|
||||
DEFAULT_VERSION)
|
||||
assert actual == {
|
||||
'image': 'alpine:edge',
|
||||
'volumes': ['.:/app'],
|
||||
'ports': ['5432']
|
||||
}
|
||||
|
||||
def test_merge_build_args(self):
|
||||
base = {
|
||||
'build': {
|
||||
|
|
Loading…
Reference in New Issue