Skip to content

Commit

Permalink
tests: update imports in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
narenaryan committed Oct 26, 2024
1 parent 621fb5d commit 8686f3c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
env:
PYTHONPATH: ./src # Needed for tests to discover whispr package
jobs:
semgrep-scan:
test:
runs-on: ubuntu-22.04

steps:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import botocore.exceptions
import structlog

from src.whispr.vault import SimpleVault
from src.whispr.aws import AWSVault
from whispr.vault import SimpleVault
from whispr.aws import AWSVault


class TestAWSVault(unittest.TestCase):
class AWSVaultTestCase(unittest.TestCase):
"""Unit tests for AWSVault class, which fetches secrets from AWS Secrets Manager."""

def setUp(self):
Expand Down Expand Up @@ -47,7 +47,7 @@ def test_fetch_secrets_resource_not_found(self):
secret_name="non_existent_secret",
)

@patch("src.whispr.aws.AWSVault.fetch_secrets")
@patch("whispr.aws.AWSVault.fetch_secrets")
def test_fetch_secrets_unrecognized_client_exception(self, mock_fetch_secrets):
"""Test fetch_secrets handles UnrecognizedClientException gracefully."""
mock_fetch_secrets.side_effect = botocore.exceptions.ClientError(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import google.api_core.exceptions
import structlog

from src.whispr.vault import SimpleVault
from src.whispr.gcp import GCPVault
from whispr.vault import SimpleVault
from whispr.gcp import GCPVault


class TestGCPVault(unittest.TestCase):
class GCPVaultTestCase(unittest.TestCase):
"""Unit tests for GCPVault class, which fetches secrets from GCP Secrets Manager."""

def setUp(self):
Expand Down
5 changes: 3 additions & 2 deletions tests/test_vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import unittest
from unittest.mock import Mock, patch

import structlog

from src.whispr.vault import SimpleVault
from whispr.vault import SimpleVault


class SimpleVaultTest(unittest.TestCase):
class SimpleVaultTestCase(unittest.TestCase):
"""Tests for Vault"""

def setUp(self):
Expand Down

0 comments on commit 8686f3c

Please sign in to comment.