-
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.
- Loading branch information
Showing
2 changed files
with
33 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
# import os | ||
# import pytest | ||
# from shipyard_googledrive import GoogleDriveClient | ||
# from dotenv import load_dotenv, find_dotenv | ||
# | ||
# load_dotenv(find_dotenv()) | ||
# | ||
# if env_exists := os.path.exists(".env"): | ||
# load_dotenv() | ||
# | ||
# | ||
# @pytest.mark.skipif(not env_exists, reason="No .env file found") | ||
# def conn_helper(client: GoogleDriveClient) -> int: | ||
# try: | ||
# client.connect() | ||
# return 0 | ||
# except Exception as e: | ||
# print("Could not connect to google drive") | ||
# return 1 | ||
# | ||
# | ||
# @pytest.mark.skipif(not env_exists, reason="No .env file found") | ||
# def test_good_connection(): | ||
# creds = os.getenv("GOOGLE_APPLICATION_CREDENTIALS") | ||
# client = GoogleDriveClient(creds) | ||
# assert conn_helper(client) == 0 | ||
# | ||
# | ||
# @pytest.mark.skipif(not env_exists, reason="No .env file found") | ||
# def test_bad_connection(): | ||
# creds = "bad_creds" | ||
# client = GoogleDriveClient(creds) | ||
# assert conn_helper(client) == 1 | ||
import os | ||
import pytest | ||
from shipyard_googledrive import GoogleDriveClient | ||
from dotenv import load_dotenv, find_dotenv | ||
|
||
load_dotenv(find_dotenv()) | ||
|
||
if env_exists := os.path.exists(".env"): | ||
load_dotenv() | ||
|
||
|
||
@pytest.mark.skipif(not env_exists, reason="No .env file found") | ||
def conn_helper(client: GoogleDriveClient) -> int: | ||
try: | ||
client.connect() | ||
return 0 | ||
except Exception as e: | ||
print("Could not connect to google drive") | ||
return 1 | ||
|
||
|
||
@pytest.mark.skipif(not env_exists, reason="No .env file found") | ||
def test_good_connection(): | ||
creds = os.getenv("GOOGLE_APPLICATION_CREDENTIALS") | ||
client = GoogleDriveClient(creds) | ||
assert conn_helper(client) == 0 | ||
|
||
|
||
@pytest.mark.skipif(not env_exists, reason="No .env file found") | ||
def test_bad_connection(): | ||
creds = "bad_creds" | ||
client = GoogleDriveClient(creds) | ||
assert conn_helper(client) == 1 |