Skip to content

Commit

Permalink
Set default region for test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Tanner Lewis <[email protected]>
  • Loading branch information
lewijacn committed Jul 10, 2024
1 parent 5262dac commit ac29db8
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from django.test import Client, SimpleTestCase
from moto import mock_aws
from rest_framework import status
Expand Down Expand Up @@ -37,8 +38,8 @@ class OrchestratorViewsTest(SimpleTestCase):

def setUp(self):
self.client = Client()
os.environ['AWS_DEFAULT_REGION'] = 'us-east-1'

@mock_aws
@patch('console_api.apps.orchestrator.views.create_pipeline_from_json')
def test_osi_create_migration(self, mock_create_pipeline_from_json):
mock_create_pipeline_from_json.return_value = None
Expand All @@ -60,7 +61,6 @@ def test_osi_create_migration_assume_role(self, mock_create_pipeline_from_json):
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertIn('Timestamp', response.data)

@mock_aws
@patch('console_api.apps.orchestrator.views.create_pipeline_from_json')
def test_osi_create_migration_fails_for_missing_field(self, mock_create_pipeline_from_json):
mock_create_pipeline_from_json.return_value = None
Expand All @@ -71,7 +71,6 @@ def test_osi_create_migration_fails_for_missing_field(self, mock_create_pipeline
content_type='application/json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)

@mock_aws
@patch('console_api.apps.orchestrator.views.start_pipeline')
def test_osi_start_migration(self, mock_start_pipeline):
mock_start_pipeline.return_value = None
Expand All @@ -93,7 +92,6 @@ def test_osi_start_migration_assume_role(self, mock_start_pipeline):
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertIn('Timestamp', response.data)

@mock_aws
@patch('console_api.apps.orchestrator.views.stop_pipeline')
def test_osi_stop_migration(self, mock_stop_pipeline):
mock_stop_pipeline.return_value = None
Expand All @@ -115,7 +113,6 @@ def test_osi_stop_migration_assume_role(self, mock_stop_pipeline):
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertIn('Timestamp', response.data)

@mock_aws
@patch('console_api.apps.orchestrator.views.delete_pipeline')
def test_osi_delete_migration(self, mock_delete_pipeline):
mock_delete_pipeline.return_value = None
Expand Down

0 comments on commit ac29db8

Please sign in to comment.