Ejemplo n.º 1
0
    def test_drive(self, dvc):
        remote = RemoteGDrive(dvc, self.CONFIG)
        os.environ[RemoteGDrive.
                   GDRIVE_CREDENTIALS_DATA] = USER_CREDS_TOKEN_REFRESH_ERROR
        with pytest.raises(GDriveAccessTokenRefreshError):
            remote._drive

        os.environ[RemoteGDrive.GDRIVE_CREDENTIALS_DATA] = ""
        remote = RemoteGDrive(dvc, self.CONFIG)
        os.environ[
            RemoteGDrive.GDRIVE_CREDENTIALS_DATA] = USER_CREDS_MISSED_KEY_ERROR
        with pytest.raises(GDriveMissedCredentialKeyError):
            remote._drive
Ejemplo n.º 2
0
def test_init_drive(repo):
    url = "gdrive://root/data"
    gdrive = RemoteGDrive(repo, {"url": url})
    assert str(gdrive.path_info) == url
Ejemplo n.º 3
0
 def test_init(self):
     remote = RemoteGDrive(Repo(), self.CONFIG)
     assert str(remote.path_info) == self.CONFIG["url"]
Ejemplo n.º 4
0
 def test_init(self, dvc):
     remote = RemoteGDrive(dvc, self.CONFIG)
     assert str(remote.path_info) == self.CONFIG["url"]
Ejemplo n.º 5
0
def gdrive(repo):
    ret = RemoteGDrive(repo, {"url": "gdrive://root/data"})
    return ret
Ejemplo n.º 6
0
def test_init_folder_id(repo):
    url = "gdrive://folder_id/data"
    gdrive = RemoteGDrive(repo, {"url": url})
    assert str(gdrive.path_info) == url