|
|
@@ -1343,8 +1343,11 @@ class ConfigTest(unittest.TestCase):
|
|
|
mount = config_data.services[0].get('volumes')[0]
|
|
|
assert mount.target == '/web'
|
|
|
assert mount.type == 'bind'
|
|
|
- assert (not mount.source.startswith('~')
|
|
|
- and mount.source.endswith('{}web'.format(os.path.sep)))
|
|
|
+ assert (
|
|
|
+ not mount.source.startswith('~') and mount.source.endswith(
|
|
|
+ '{}web'.format(os.path.sep)
|
|
|
+ )
|
|
|
+ )
|
|
|
|
|
|
def test_config_invalid_ipam_config(self):
|
|
|
with pytest.raises(ConfigurationError) as excinfo:
|
|
|
@@ -2667,6 +2670,45 @@ class ConfigTest(unittest.TestCase):
|
|
|
['c 7:128 rwm', 'x 3:244 rw', 'f 0:128 n']
|
|
|
)
|
|
|
|
|
|
+ def test_merge_isolation(self):
|
|
|
+ base = {
|
|
|
+ 'image': 'bar',
|
|
|
+ 'isolation': 'default',
|
|
|
+ }
|
|
|
+
|
|
|
+ override = {
|
|
|
+ 'isolation': 'hyperv',
|
|
|
+ }
|
|
|
+
|
|
|
+ actual = config.merge_service_dicts(base, override, V2_3)
|
|
|
+ assert actual == {
|
|
|
+ 'image': 'bar',
|
|
|
+ 'isolation': 'hyperv',
|
|
|
+ }
|
|
|
+
|
|
|
+ def test_merge_storage_opt(self):
|
|
|
+ base = {
|
|
|
+ 'image': 'bar',
|
|
|
+ 'storage_opt': {
|
|
|
+ 'size': '1G',
|
|
|
+ 'readonly': 'false',
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ override = {
|
|
|
+ 'storage_opt': {
|
|
|
+ 'size': '2G',
|
|
|
+ 'encryption': 'aes',
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ actual = config.merge_service_dicts(base, override, V2_3)
|
|
|
+ assert actual['storage_opt'] == {
|
|
|
+ 'size': '2G',
|
|
|
+ 'readonly': 'false',
|
|
|
+ 'encryption': 'aes',
|
|
|
+ }
|
|
|
+
|
|
|
def test_external_volume_config(self):
|
|
|
config_details = build_config_details({
|
|
|
'version': '2',
|