예제 #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
파일: remotes.py 프로젝트: wegamekinglc/dvc
 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