示例#1
0
 def test_parse_volume_spec_internal_and_external(self):
     spec = parse_volume_spec('external:interval')
     self.assertEqual(spec, ('external', 'interval', 'rw'))
示例#2
0
 def test_building_volume_binding_with_home(self):
     os.environ["HOME"] = "/home/user"
     binding = build_volume_binding(parse_volume_spec("~:/home/user"))
     self.assertEqual(binding, ("/home/user", dict(bind="/home/user", ro=False)))
示例#3
0
 def test_parse_volume_spec_only_one_path(self):
     spec = parse_volume_spec('/the/volume')
     self.assertEqual(spec, (None, '/the/volume', 'rw'))
示例#4
0
 def test_parse_volume_spec_internal_and_external(self):
     spec = parse_volume_spec('external:interval')
     self.assertEqual(spec, ('external', 'interval', 'rw'))
示例#5
0
 def test_build_volume_binding_with_environ(self):
     os.environ["VOLUME_PATH"] = "/opt"
     binding = build_volume_binding(parse_volume_spec("${VOLUME_PATH}:/opt"))
     self.assertEqual(binding, ("/opt", dict(bind="/opt", ro=False)))
示例#6
0
 def test_parse_volume_bad_mode(self):
     with self.assertRaises(ConfigError):
         parse_volume_spec('one:two:notrw')
示例#7
0
 def test_build_volume_binding_with_environ(self):
     os.environ['VOLUME_PATH'] = '/opt'
     binding = build_volume_binding(parse_volume_spec('${VOLUME_PATH}:/opt'))
     self.assertEqual(binding, ('/opt', dict(bind='/opt', ro=False)))
示例#8
0
 def test_building_volume_binding_with_home(self):
     os.environ['HOME'] = '/home/user'
     binding = build_volume_binding(parse_volume_spec('~:/home/user'))
     self.assertEqual(
         binding,
         ('/home/user', dict(bind='/home/user', ro=False)))
示例#9
0
 def test_parse_volume_spec_only_one_path(self):
     spec = parse_volume_spec("/the/volume")
     self.assertEqual(spec, (None, "/the/volume", "rw"))
示例#10
0
 def test_build_volume_binding(self):
     binding = build_volume_binding(parse_volume_spec('/outside:/inside'))
     self.assertEqual(
         binding,
         ('/outside', dict(bind='/inside', ro=False)))
示例#11
0
 def test_build_volume_binding_with_environ(self):
     os.environ['VOLUME_PATH'] = '/opt'
     binding = build_volume_binding(parse_volume_spec('${VOLUME_PATH}:/opt'))
     self.assertEqual(binding, ('/opt', dict(bind='/opt', ro=False)))
示例#12
0
 def test_parse_volume_bad_mode(self):
     with self.assertRaises(ConfigError):
         parse_volume_spec('one:two:notrw')
示例#13
0
 def test_parse_volume_spec_too_many_parts(self):
     with self.assertRaises(ConfigError):
         parse_volume_spec('one:two:three:four')
示例#14
0
 def test_parse_volume_spec_with_mode(self):
     spec = parse_volume_spec('external:interval:ro')
     self.assertEqual(spec, ('external', 'interval', 'ro'))
示例#15
0
 def test_parse_volume_spec_with_mode(self):
     spec = parse_volume_spec('external:interval:ro')
     self.assertEqual(spec, ('external', 'interval', 'ro'))
示例#16
0
 def test_parse_volume_spec_internal_and_external(self):
     spec = parse_volume_spec("external:interval")
     self.assertEqual(spec, ("external", "interval", "rw"))
示例#17
0
 def test_parse_volume_spec_too_many_parts(self):
     with self.assertRaises(ConfigError):
         parse_volume_spec('one:two:three:four')
示例#18
0
 def test_parse_volume_spec_with_mode(self):
     spec = parse_volume_spec("external:interval:ro")
     self.assertEqual(spec, ("external", "interval", "ro"))
示例#19
0
 def test_build_volume_binding(self):
     binding = build_volume_binding(parse_volume_spec('/outside:/inside'))
     self.assertEqual(
         binding,
         ('/outside', dict(bind='/inside', ro=False)))
示例#20
0
 def test_build_volume_binding(self):
     binding = build_volume_binding(parse_volume_spec("/outside:/inside"))
     self.assertEqual(binding, ("/outside", dict(bind="/inside", ro=False)))
示例#21
0
 def test_building_volume_binding_with_home(self):
     os.environ['HOME'] = '/home/user'
     binding = build_volume_binding(parse_volume_spec('~:/home/user'))
     self.assertEqual(
         binding,
         ('/home/user', dict(bind='/home/user', ro=False)))
示例#22
0
 def test_parse_volume_spec_only_one_path(self):
     spec = parse_volume_spec('/the/volume')
     self.assertEqual(spec, (None, '/the/volume', 'rw'))