Esempio n. 1
0
 def test_parse_volume_spec_internal_and_external(self):
     spec = parse_volume_spec('external:interval')
     self.assertEqual(spec, ('external', 'interval', 'rw'))
Esempio n. 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)))
Esempio n. 3
0
 def test_parse_volume_spec_only_one_path(self):
     spec = parse_volume_spec('/the/volume')
     self.assertEqual(spec, (None, '/the/volume', 'rw'))
Esempio n. 4
0
 def test_parse_volume_spec_internal_and_external(self):
     spec = parse_volume_spec('external:interval')
     self.assertEqual(spec, ('external', 'interval', 'rw'))
Esempio n. 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)))
Esempio n. 6
0
 def test_parse_volume_bad_mode(self):
     with self.assertRaises(ConfigError):
         parse_volume_spec('one:two:notrw')
Esempio n. 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)))
Esempio n. 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)))
Esempio n. 9
0
 def test_parse_volume_spec_only_one_path(self):
     spec = parse_volume_spec("/the/volume")
     self.assertEqual(spec, (None, "/the/volume", "rw"))
Esempio n. 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)))
Esempio n. 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)))
Esempio n. 12
0
 def test_parse_volume_bad_mode(self):
     with self.assertRaises(ConfigError):
         parse_volume_spec('one:two:notrw')
Esempio n. 13
0
 def test_parse_volume_spec_too_many_parts(self):
     with self.assertRaises(ConfigError):
         parse_volume_spec('one:two:three:four')
Esempio n. 14
0
 def test_parse_volume_spec_with_mode(self):
     spec = parse_volume_spec('external:interval:ro')
     self.assertEqual(spec, ('external', 'interval', 'ro'))
Esempio n. 15
0
 def test_parse_volume_spec_with_mode(self):
     spec = parse_volume_spec('external:interval:ro')
     self.assertEqual(spec, ('external', 'interval', 'ro'))
Esempio n. 16
0
 def test_parse_volume_spec_internal_and_external(self):
     spec = parse_volume_spec("external:interval")
     self.assertEqual(spec, ("external", "interval", "rw"))
Esempio n. 17
0
 def test_parse_volume_spec_too_many_parts(self):
     with self.assertRaises(ConfigError):
         parse_volume_spec('one:two:three:four')
Esempio n. 18
0
 def test_parse_volume_spec_with_mode(self):
     spec = parse_volume_spec("external:interval:ro")
     self.assertEqual(spec, ("external", "interval", "ro"))
Esempio n. 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)))
Esempio n. 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)))
Esempio n. 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)))
Esempio n. 22
0
 def test_parse_volume_spec_only_one_path(self):
     spec = parse_volume_spec('/the/volume')
     self.assertEqual(spec, (None, '/the/volume', 'rw'))