Fix service dict merging when only one dict has a volumes key
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
b7046777d1
commit
276e43ca6b
2 changed files with 27 additions and 1 deletions
|
|
@ -39,6 +39,29 @@ class ConfigTest(unittest.TestCase):
|
|||
config.make_service_dict('foo', {'ports': ['8000']})
|
||||
|
||||
|
||||
class MergeTest(unittest.TestCase):
|
||||
def test_merge_volumes(self):
|
||||
service_dict = config.merge_service_dicts({}, {})
|
||||
self.assertNotIn('volumes', service_dict)
|
||||
|
||||
service_dict = config.merge_service_dicts({
|
||||
'volumes': ['/foo:/data'],
|
||||
}, {})
|
||||
self.assertEqual(service_dict['volumes'], ['/foo:/data'])
|
||||
|
||||
service_dict = config.merge_service_dicts({}, {
|
||||
'volumes': ['/bar:/data'],
|
||||
})
|
||||
self.assertEqual(service_dict['volumes'], ['/bar:/data'])
|
||||
|
||||
service_dict = config.merge_service_dicts({
|
||||
'volumes': ['/foo:/data'],
|
||||
}, {
|
||||
'volumes': ['/bar:/data'],
|
||||
})
|
||||
self.assertEqual(service_dict['volumes'], ['/bar:/data'])
|
||||
|
||||
|
||||
class EnvTest(unittest.TestCase):
|
||||
def test_parse_environment_as_list(self):
|
||||
environment =[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue