Skip to content

Commit

Permalink
fix(schematic): mock os environ to force use of local creds when test…
Browse files Browse the repository at this point in the history
…ing (#2627)
  • Loading branch information
andrewelamb authored Apr 19, 2024
1 parent 560fbf6 commit db9369e
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 db9369e

Please sign in to comment.