Port test suite from nose to pytest.
This just eliminates all errors on the tests collection. Elimination of failures is left to the next commit.
This commit is contained in:
parent
47dbad291e
commit
77dc60ea97
146 changed files with 1172 additions and 1277 deletions
|
|
@ -4,11 +4,11 @@ import boto
|
|||
import boto3
|
||||
from botocore.exceptions import ClientError
|
||||
from moto import mock_datasync
|
||||
from nose.tools import assert_raises
|
||||
import pytest
|
||||
|
||||
|
||||
def create_locations(client, create_smb=False, create_s3=False):
|
||||
"""
|
||||
"""
|
||||
Convenience function for creating locations.
|
||||
Locations must exist before tasks can be created.
|
||||
"""
|
||||
|
|
@ -101,7 +101,7 @@ def test_describe_location_wrong():
|
|||
Password="",
|
||||
AgentArns=agent_arns,
|
||||
)
|
||||
with assert_raises(ClientError) as e:
|
||||
with pytest.raises(ClientError) as e:
|
||||
response = client.describe_location_s3(LocationArn=response["LocationArn"])
|
||||
|
||||
|
||||
|
|
@ -159,11 +159,11 @@ def test_create_task_fail():
|
|||
""" Test that Locations must exist before a Task can be created """
|
||||
client = boto3.client("datasync", region_name="us-east-1")
|
||||
locations = create_locations(client, create_smb=True, create_s3=True)
|
||||
with assert_raises(ClientError) as e:
|
||||
with pytest.raises(ClientError) as e:
|
||||
response = client.create_task(
|
||||
SourceLocationArn="1", DestinationLocationArn=locations["s3_arn"]
|
||||
)
|
||||
with assert_raises(ClientError) as e:
|
||||
with pytest.raises(ClientError) as e:
|
||||
response = client.create_task(
|
||||
SourceLocationArn=locations["smb_arn"], DestinationLocationArn="2"
|
||||
)
|
||||
|
|
@ -220,7 +220,7 @@ def test_describe_task():
|
|||
def test_describe_task_not_exist():
|
||||
client = boto3.client("datasync", region_name="us-east-1")
|
||||
|
||||
with assert_raises(ClientError) as e:
|
||||
with pytest.raises(ClientError) as e:
|
||||
client.describe_task(TaskArn="abc")
|
||||
|
||||
|
||||
|
|
@ -328,7 +328,7 @@ def test_start_task_execution_twice():
|
|||
assert "TaskExecutionArn" in response
|
||||
task_execution_arn = response["TaskExecutionArn"]
|
||||
|
||||
with assert_raises(ClientError) as e:
|
||||
with pytest.raises(ClientError) as e:
|
||||
response = client.start_task_execution(TaskArn=task_arn)
|
||||
|
||||
|
||||
|
|
@ -392,7 +392,7 @@ def test_describe_task_execution():
|
|||
def test_describe_task_execution_not_exist():
|
||||
client = boto3.client("datasync", region_name="us-east-1")
|
||||
|
||||
with assert_raises(ClientError) as e:
|
||||
with pytest.raises(ClientError) as e:
|
||||
client.describe_task_execution(TaskExecutionArn="abc")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue