Skip to content

Commit

Permalink
Mocking client classes to fix credential errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-moore-97 committed Oct 18, 2023
1 parent 7e26512 commit 8e1c59c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: FastAPI",
"type": "python",
"request": "launch",
"module": "uvicorn",
"args": [
"main:app",
"--reload"
],
"jinja": true,
"justMyCode": true
}
]
}
25 changes: 25 additions & 0 deletions cred.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"credentials": {
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"client_email": "[email protected]",
"client_id": "111242688923059078080",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/drive-test%40striking-berm-212615.iam.gserviceaccount.com",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCyItT8Gmki+l8X\nwc8pbze/g1fh67aHrmTcIx6f8X9Gn0p+zuXCY41tYJSbVuIwixkkUk2H1ctmdbaS\n4qo87qZ7EoakOW7j9v3MKZ9aV8KaLgeMgmvpOGdURIs3R1rIv3CfpuRQlrEiwQAx\nW2aAQGGcNqtfosrNfXTTamfyou+SmDnBEfdqdoFKSfb8EfNL6KrDRP/zAhebCn/m\n6Lcr+M3wiVjZRqRtl8N05K+j09f5EK30S3552H9jo+5vPuyrrNpK36j+oyCRwa5G\nB+aEBxYH/GTUxgmuChXB46KHYbKfQjYVSSh8trJndtavCs8k+04sDbz0IUoBh304\nBX7WG1EVAgMBAAECggEAA7tDZI/gZu6sDPEu4pU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/eDeucM9JmLqg/zZkW9X3Vn988YWNfgE9lCcj7mN12HY+ZLf0c8Agwu+1wfhcOxk\nkM6x+bNG3Xm/yAnj2SPwX6VcwVklNorQCAoAjsH11CoGhsRbYVA3WmJEbrXOGN3r\n+jZi3KLsaBYa9X3fNdfO2A==\n-----END PRIVATE KEY-----\n",
"private_key_id": "8dd0b76661667d198162c8891a6f70e9fa281834",
"project_id": "striking-berm-212615",
"token_uri": "https://oauth2.googleapis.com/token",
"type": "service_account"
},
"analytics_root": "0AOiZ5XFyLraQUk9PVA",
"analytics_property_id": 377091467,
"root_directory": "0AGywiIMY--t5Uk9PVA",
"sheets_id": "1Cu7hnTp1iT-zIkg8yT00GXL5NQg8f6UhSdJD-Bvdw8Y",
"db_name": "cgawsbrokerprodn9m9imvos3005d6",
"host": "cg-aws-broker-prodn9m9imvos3005d6.ci7nkegdizyy.us-gov-west-1.rds.amazonaws.com",
"name": "cgawsbrokerprodn9m9imvos3005d6",
"password": "t5fcs8h5o5bpluk0wnlb783yo",
"port": "40867",
"uri": "postgresql://ua5mtf5jthtw93j2:t5fcs8h5o5bpluk0wnlb783yo@cg-aws-broker-prodn9m9imvos3005d6.ci7nkegdizyy.us-gov-west-1.rds.amazonaws.com:40867/cgawsbrokerprodn9m9imvos3005d6",
"username": "ua5mtf5jthtw93j2"
}
2 changes: 2 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

# pylint: disable=wrong-import-position
sys.modules["gdrive.drive_client"] = MagicMock()
sys.modules["gdrive.analytics_client"] = MagicMock()
sys.modules["gdrive.sheets_client"] = MagicMock()
from gdrive import main

client = testclient.TestClient(main.app)
Expand Down

0 comments on commit 8e1c59c

Please sign in to comment.