示例#1
0
 def test_init(self):
     remote = RemoteGS(None, self.CONFIG)
     self.assertEqual(remote.url, self.URL)
     self.assertEqual(remote.prefix, self.PREFIX)
     self.assertEqual(remote.bucket, self.BUCKET)
     self.assertEqual(remote.projectname, self.PROJECT)
     self.assertEqual(remote.credentialpath, self.CREDENTIALPATH)
示例#2
0
文件: gs.py 项目: yustoris/dvc
 def __init__(self, stage, path, info=None, remote=None):
     super(DependencyGS, self).__init__(stage, path)
     self.info = info
     self.remote = remote if remote else RemoteGS(stage.project, {})
     bucket = remote.bucket if remote else urlparse(path).netloc
     key = urlparse(path).path.lstrip('/')
     if remote:
         key = posixpath.join(remote.prefix, key)
     self.path_info = {'scheme': 'gs', 'bucket': bucket, 'key': key}
示例#3
0
 def __init__(self, stage, path, info=None):
     super(DependencyGS, self).__init__(stage, path)
     self.info = info
     self.remote = RemoteGS(stage.project, {Config.SECTION_REMOTE_URL: '/'})
     self.path_info = {
         'scheme': 'gs',
         'bucket': urlparse(path).netloc,
         'key': urlparse(path).path.lstrip('/')
     }
示例#4
0
 def remote(cls):
     yield RemoteGS(None, {"url": cls.get_url()})
示例#5
0
 def test_gs_no_credspath(self, mock_client):
     config = self.CONFIG.copy()
     del config["credentialpath"]
     remote = RemoteGS(None, config)
     remote.gs()
     mock_client.assert_called_with(self.PROJECT)
示例#6
0
 def test_gs(self, mock_client):
     remote = RemoteGS(None, self.CONFIG)
     self.assertTrue(remote.credentialpath)
     remote.gs()
     mock_client.assert_called_once_with(self.CREDENTIALPATH)
示例#7
0
 def test_init(self):
     remote = RemoteGS(None, self.CONFIG)
     self.assertEqual(remote.path_info, self.URL)
     self.assertEqual(remote.projectname, self.PROJECT)
     self.assertEqual(remote.credentialpath, self.CREDENTIALPATH)
示例#8
0
 def remote(cls):
     remote = RemoteGS(None, {"url": cls.get_url()})
     yield remote
示例#9
0
文件: gs.py 项目: yfarjoun/dvc
 def test_gs(self, mock_client):
     remote = RemoteGS(None, self.CONFIG)
     remote.gs()
     mock_client.assert_called_with(self.PROJECT)
示例#10
0
 def remote(cls, repo):
     yield RemoteGS(repo, {"url": cls.get_url()})
示例#11
0
文件: test_gs.py 项目: shizacat/dvc
def test_gs_no_credspath(mock_client, dvc):
    config = CONFIG.copy()
    del config["credentialpath"]
    remote = RemoteGS(dvc, config)
    remote.gs()
    mock_client.assert_called_with(PROJECT)
示例#12
0
文件: test_gs.py 项目: shizacat/dvc
def test_gs(mock_client, dvc):
    remote = RemoteGS(dvc, CONFIG)
    assert remote.credentialpath
    remote.gs()
    mock_client.assert_called_once_with(CREDENTIALPATH)
示例#13
0
文件: test_gs.py 项目: shizacat/dvc
def test_init(dvc):
    remote = RemoteGS(dvc, CONFIG)
    assert remote.path_info == URL
    assert remote.projectname == PROJECT
    assert remote.credentialpath == CREDENTIALPATH