Skip to content

Commit

Permalink
Fixes for Travis Tests
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffrey Wiseman <geoffrey.wiseman@codiform.com>
  • Loading branch information
geoffreywiseman committed Oct 2, 2020
1 parent 8ac6ce8 commit 944094f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,22 @@ def region_fixture():
region = 'ca-central-1'
os.environ[AWS_DEFAULT_REGION] = region
yield region
del os.environ[AWS_DEFAULT_REGION]
if AWS_DEFAULT_REGION in os.environ:
del os.environ[AWS_DEFAULT_REGION]


@pytest.fixture(name='security_group', scope='function')
def security_group_fixture():
mock_ec2().start()
mock = mock_ec2()
mock.start()
ec2 = boto3.resource('ec2')
sg = ec2.create_security_group(
Description='Security Group for SSH Whitelisting',
GroupName='SSH Whitelist',
VpcId='vpc-123'
)
yield sg
mock_ec2().stop()
mock.stop()


@patch('sys.stdout', new_callable=io.StringIO)
Expand Down

0 comments on commit 944094f

Please sign in to comment.