-
Notifications
You must be signed in to change notification settings - Fork 17
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
1 parent
94285be
commit 343968d
Showing
2 changed files
with
22 additions
and
15 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/meshapi/tests/test_join_record_processor_bad_env_vars.py
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
from unittest.mock import patch | ||
from botocore.exceptions import ClientError | ||
from django.test import TestCase | ||
|
||
from meshapi.util.join_records import JoinRecordProcessor | ||
|
||
class TestJoinRecordProcessorBadEnvVars(TestCase): | ||
@patch("meshapi.util.join_records.JOIN_RECORD_BUCKET_NAME", "") | ||
def test_missing_bucket_name(self): | ||
with self.assertRaises(EnvironmentError): | ||
JoinRecordProcessor() | ||
|
||
@patch("meshapi.util.join_records.JOIN_RECORD_PREFIX", "") | ||
def test_missing_prefix(self): | ||
with self.assertRaises(EnvironmentError): | ||
JoinRecordProcessor() | ||
|
||
@patch("meshapi.util.join_records.JOIN_RECORD_BUCKET_NAME", "chom") | ||
def test_bad_bucket_name(self): | ||
with self.assertRaises(ClientError): | ||
JoinRecordProcessor().get_all() |
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