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)
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}
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('/') }
def remote(cls): yield RemoteGS(None, {"url": cls.get_url()})
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)
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)
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)
def remote(cls): remote = RemoteGS(None, {"url": cls.get_url()}) yield remote
def test_gs(self, mock_client): remote = RemoteGS(None, self.CONFIG) remote.gs() mock_client.assert_called_with(self.PROJECT)
def remote(cls, repo): yield RemoteGS(repo, {"url": cls.get_url()})
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)
def test_gs(mock_client, dvc): remote = RemoteGS(dvc, CONFIG) assert remote.credentialpath remote.gs() mock_client.assert_called_once_with(CREDENTIALPATH)
def test_init(dvc): remote = RemoteGS(dvc, CONFIG) assert remote.path_info == URL assert remote.projectname == PROJECT assert remote.credentialpath == CREDENTIALPATH