Пример #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
Пример #2
0
def test_init_drive(repo):
    url = "gdrive://root/data"
    gdrive = RemoteGDrive(repo, {"url": url})
    assert str(gdrive.path_info) == url
Пример #3
0
 def test_init(self):
     remote = RemoteGDrive(Repo(), self.CONFIG)
     assert str(remote.path_info) == self.CONFIG["url"]
Пример #4
0
 def test_init(self, dvc):
     remote = RemoteGDrive(dvc, self.CONFIG)
     assert str(remote.path_info) == self.CONFIG["url"]
Пример #5
0
def gdrive(repo):
    ret = RemoteGDrive(repo, {"url": "gdrive://root/data"})
    return ret
Пример #6
0
def test_init_folder_id(repo):
    url = "gdrive://folder_id/data"
    gdrive = RemoteGDrive(repo, {"url": url})
    assert str(gdrive.path_info) == url