-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drive class tested using new Auth class
- Loading branch information
1 parent
fb80963
commit 671293d
Showing
6 changed files
with
50 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
test column key,test column value | ||
test1,1 | ||
test2,2 | ||
test3,3 | ||
test4,4 | ||
test5,5 |
6 changes: 6 additions & 0 deletions
6
tests/__testsDatafiles/drive_testFiles/test_folder/test_file1.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
test column key,test column value | ||
test1,1 | ||
test2,2 | ||
test3,3 | ||
test4,4 | ||
test5,5 |
6 changes: 6 additions & 0 deletions
6
tests/__testsDatafiles/drive_testFiles/test_folder/test_file2.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
test column key,test column value | ||
test1,1 | ||
test2,2 | ||
test3,3 | ||
test4,4 | ||
test5,5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import unittest | ||
import os | ||
|
||
from Driveup.drive import Drive | ||
|
||
tests_dir = os.path.dirname(os.path.abspath(__file__)) # Driveup/tests/ | ||
|
||
CREDENTIALS_PATH = os.path.join(tests_dir,"__testsDataFiles","auth_testFiles","credentials.json") | ||
CLIENT_SECRET_PATH = os.path.join(tests_dir,"__testsDataFiles","auth_testFiles","client_secrets.json") | ||
UPLOAD_FILE_PATH = os.path.join(tests_dir,"__testsDataFiles","drive_testFiles","test_file.csv") | ||
UPLOAD_FOLDER_PATH = os.path.join(tests_dir,"__testsDataFiles","drive_testFiles","test_folder") | ||
DRIVE_FOLDER_ID = 'https://drive.google.com/drive/folders/1wXpG03SN0RXI7y1QAd03IDGH2eXFD_VS' | ||
|
||
class TestDrive(unittest.TestCase): | ||
def test_upload(self): | ||
drive_obj = Drive(client_secret_path=CLIENT_SECRET_PATH,credentials_path=CREDENTIALS_PATH) | ||
drive_obj.upload(UPLOAD_FILE_PATH,DRIVE_FOLDER_ID) | ||
|
||
def test_upload_folder(self): | ||
drive_obj = Drive(credentials_path=CREDENTIALS_PATH,client_secret_path=CLIENT_SECRET_PATH) | ||
drive_obj.upload_folder(UPLOAD_FOLDER_PATH,DRIVE_FOLDER_ID) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() | ||
# Auth tests can't be tested simultaneously (API conflict) |