Merge pull request #1817 from aanand/update-volume-tests
Update volume tests for clarity
This commit is contained in:
commit
22b7ee42de
1 changed files with 4 additions and 4 deletions
|
|
@ -117,7 +117,7 @@ class InterpolationTest(unittest.TestCase):
|
||||||
d = make_service_dict('foo', {'volumes': ['~:/container/path']}, working_dir='.')
|
d = make_service_dict('foo', {'volumes': ['~:/container/path']}, working_dir='.')
|
||||||
self.assertEqual(d['volumes'], ['/home/user:/container/path'])
|
self.assertEqual(d['volumes'], ['/home/user:/container/path'])
|
||||||
|
|
||||||
def test_named_volume_with_driver(self):
|
def test_named_volume_with_driver_does_not_expand(self):
|
||||||
d = make_service_dict('foo', {
|
d = make_service_dict('foo', {
|
||||||
'volumes': ['namedvolume:/data'],
|
'volumes': ['namedvolume:/data'],
|
||||||
'volume_driver': 'foodriver',
|
'volume_driver': 'foodriver',
|
||||||
|
|
@ -125,13 +125,13 @@ class InterpolationTest(unittest.TestCase):
|
||||||
self.assertEqual(d['volumes'], ['namedvolume:/data'])
|
self.assertEqual(d['volumes'], ['namedvolume:/data'])
|
||||||
|
|
||||||
@mock.patch.dict(os.environ)
|
@mock.patch.dict(os.environ)
|
||||||
def test_named_volume_with_special_chars(self):
|
def test_home_directory_with_driver_does_not_expand(self):
|
||||||
os.environ['NAME'] = 'surprise!'
|
os.environ['NAME'] = 'surprise!'
|
||||||
d = make_service_dict('foo', {
|
d = make_service_dict('foo', {
|
||||||
'volumes': ['~/${NAME}:/data'],
|
'volumes': ['~:/data'],
|
||||||
'volume_driver': 'foodriver',
|
'volume_driver': 'foodriver',
|
||||||
}, working_dir='.')
|
}, working_dir='.')
|
||||||
self.assertEqual(d['volumes'], ['~/${NAME}:/data'])
|
self.assertEqual(d['volumes'], ['~:/data'])
|
||||||
|
|
||||||
|
|
||||||
class MergePathMappingTest(object):
|
class MergePathMappingTest(object):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue