mirror of
https://github.com/docker/compose.git
synced 2025-07-06 13:24:25 +02:00
Merge pull request #1970 from mnowster/fix-expose-allowed-values
fix expose schema definition
This commit is contained in:
commit
dcf2f3f28c
@ -42,7 +42,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
"expose": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"expose": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {"type": ["string", "number"]},
|
||||||
|
"uniqueItems": true
|
||||||
|
},
|
||||||
|
|
||||||
"extends": {
|
"extends": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -239,6 +239,21 @@ class ConfigTest(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_valid_config_which_allows_two_type_definitions(self):
|
||||||
|
expose_values = [["8000"], [8000]]
|
||||||
|
for expose in expose_values:
|
||||||
|
service = config.load(
|
||||||
|
config.ConfigDetails(
|
||||||
|
{'web': {
|
||||||
|
'image': 'busybox',
|
||||||
|
'expose': expose
|
||||||
|
}},
|
||||||
|
'working_dir',
|
||||||
|
'filename.yml'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
self.assertEqual(service[0]['expose'], expose)
|
||||||
|
|
||||||
|
|
||||||
class InterpolationTest(unittest.TestCase):
|
class InterpolationTest(unittest.TestCase):
|
||||||
@mock.patch.dict(os.environ)
|
@mock.patch.dict(os.environ)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user