Skip to content

Commit

Permalink
mock os environ to force use of local creds when testing
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewelamb committed Apr 10, 2024
1 parent d503473 commit b3f7ddc
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import json
import os
from unittest import mock

import pytest
import yaml
Expand Down Expand Up @@ -43,6 +44,9 @@
class TestGenerateGoogleSheetManifests(BaseTestCase):
"""Tests google sheet manifest endpoint"""

# local environment has variable 'SECRETS_MANAGER_SECRETS that causes an error when creating
# google credentials
@mock.patch.dict(os.environ, {}, clear=True)
def test_success1(self) -> None:
"""Test for successful result"""
url = (
Expand All @@ -62,6 +66,9 @@ def test_success1(self) -> None:
assert isinstance(links, list)
assert len(links) == 2

# local environment has variable 'SECRETS_MANAGER_SECRETS that causes an error when creating
# google credentials
@mock.patch.dict(os.environ, {}, clear=True)
def test_success2(self) -> None:
"""Test for successful result"""
url = (
Expand Down

0 comments on commit b3f7ddc

Please sign in to comment.