コード例 #1
0
 def test_parse_mount_bind_windows(self):
     with mock.patch('docker.types.services.IS_WINDOWS_PLATFORM', True):
         mount = Mount.parse_mount_string('C:/foo/bar:/baz')
     assert mount['Source'] == "C:/foo/bar"
     assert mount['Target'] == "/baz"
     assert mount['Type'] == 'bind'
コード例 #2
0
 def test_parse_mount_named_volume(self):
     mount = Mount.parse_mount_string("foobar:/baz")
     assert mount['Source'] == 'foobar'
     assert mount['Target'] == '/baz'
     assert mount['Type'] == 'volume'
コード例 #3
0
 def test_parse_mount_bind(self):
     mount = Mount.parse_mount_string('/foo/bar:/baz')
     assert mount['Source'] == "/foo/bar"
     assert mount['Target'] == "/baz"
     assert mount['Type'] == 'bind'
コード例 #4
0
 def test_parse_mount_string_no_source(self):
     mount = Mount.parse_mount_string("foo/bar")
     assert mount['Source'] is None
     assert mount['Target'] == "foo/bar"
     assert not mount['ReadOnly']
コード例 #5
0
 def test_parse_mount_string_invalid(self):
     with pytest.raises(InvalidArgument):
         Mount.parse_mount_string("foo:bar:baz:rw")
コード例 #6
0
 def test_parse_mount_string_ro(self):
     mount = Mount.parse_mount_string("/foo/bar:/baz:ro")
     assert mount['Source'] == "/foo/bar"
     assert mount['Target'] == "/baz"
     assert mount['ReadOnly'] is True
コード例 #7
0
 def test_parse_mount_string_short_form(self):
     mount = Mount.parse_mount_string("/foo/bar:/baz")
     assert mount['Source'] == "/foo/bar"
     assert mount['Target'] == "/baz"
     assert not mount['ReadOnly']
コード例 #8
0
ファイル: dockertypes_test.py プロジェクト: docker/docker-py
 def test_parse_mount_bind(self):
     mount = Mount.parse_mount_string('/foo/bar:/baz')
     assert mount['Source'] == "/foo/bar"
     assert mount['Target'] == "/baz"
     assert mount['Type'] == 'bind'
コード例 #9
0
ファイル: dockertypes_test.py プロジェクト: docker/docker-py
 def test_parse_mount_bind_windows(self):
     with mock.patch('docker.types.services.IS_WINDOWS_PLATFORM', True):
         mount = Mount.parse_mount_string('C:/foo/bar:/baz')
     assert mount['Source'] == "C:/foo/bar"
     assert mount['Target'] == "/baz"
     assert mount['Type'] == 'bind'
コード例 #10
0
ファイル: dockertypes_test.py プロジェクト: docker/docker-py
 def test_parse_mount_named_volume(self):
     mount = Mount.parse_mount_string("foobar:/baz")
     assert mount['Source'] == 'foobar'
     assert mount['Target'] == '/baz'
     assert mount['Type'] == 'volume'
コード例 #11
0
ファイル: dockertypes_test.py プロジェクト: docker/docker-py
 def test_parse_mount_string_invalid(self):
     with pytest.raises(InvalidArgument):
         Mount.parse_mount_string("foo:bar:baz:rw")
コード例 #12
0
ファイル: dockertypes_test.py プロジェクト: docker/docker-py
 def test_parse_mount_string_no_source(self):
     mount = Mount.parse_mount_string("foo/bar")
     assert mount['Source'] is None
     assert mount['Target'] == "foo/bar"
     assert not mount['ReadOnly']
コード例 #13
0
ファイル: dockertypes_test.py プロジェクト: docker/docker-py
 def test_parse_mount_string_short_form(self):
     mount = Mount.parse_mount_string("/foo/bar:/baz")
     assert mount['Source'] == "/foo/bar"
     assert mount['Target'] == "/baz"
     assert not mount['ReadOnly']
コード例 #14
0
ファイル: dockertypes_test.py プロジェクト: docker/docker-py
 def test_parse_mount_string_ro(self):
     mount = Mount.parse_mount_string("/foo/bar:/baz:ro")
     assert mount['Source'] == "/foo/bar"
     assert mount['Target'] == "/baz"
     assert mount['ReadOnly'] is True