Пример #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
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
def test_gs(mock_client, dvc):
    remote = RemoteGS(dvc, CONFIG)
    assert remote.credentialpath
    remote.gs()
    mock_client.assert_called_once_with(CREDENTIALPATH)
Пример #13
0
def test_init(dvc):
    remote = RemoteGS(dvc, CONFIG)
    assert remote.path_info == URL
    assert remote.projectname == PROJECT
    assert remote.credentialpath == CREDENTIALPATH