Add SWF domain and type undeprecation

Signed-off-by: Laurie O <laurie_opperman@hotmail.com>
This commit is contained in:
Laurie O 2020-03-05 23:37:17 +10:00
commit 916add9ac5
No known key found for this signature in database
GPG key ID: AAA23A02196FC956
5 changed files with 235 additions and 0 deletions

View file

@ -1,8 +1,11 @@
import boto
from boto.swf.exceptions import SWFResponseError
import boto3
from botocore.exceptions import ClientError
import sure # noqa
from moto import mock_swf_deprecated
from moto import mock_swf
# RegisterDomain endpoint
@ -94,6 +97,56 @@ def test_deprecate_non_existent_domain():
)
# UndeprecateDomain endpoint
@mock_swf
def test_undeprecate_domain():
client = boto3.client("swf", region_name="us-east-1")
client.register_domain(
name="test-domain", workflowExecutionRetentionPeriodInDays="60"
)
client.deprecate_domain(name="test-domain")
client.undeprecate_domain(name="test-domain")
resp = client.describe_domain(name="test-domain")
resp["domainInfo"]["status"].should.equal("REGISTERED")
@mock_swf
def test_undeprecate_already_undeprecated_domain():
client = boto3.client("swf", region_name="us-east-1")
client.register_domain(
name="test-domain", workflowExecutionRetentionPeriodInDays="60"
)
client.deprecate_domain(name="test-domain")
client.undeprecate_domain(name="test-domain")
client.undeprecate_domain.when.called_with(name="test-domain").should.throw(
ClientError
)
@mock_swf
def test_undeprecate_never_deprecated_domain():
client = boto3.client("swf", region_name="us-east-1")
client.register_domain(
name="test-domain", workflowExecutionRetentionPeriodInDays="60"
)
client.undeprecate_domain.when.called_with(name="test-domain").should.throw(
ClientError
)
@mock_swf
def test_undeprecate_non_existent_domain():
client = boto3.client("swf", region_name="us-east-1")
client.undeprecate_domain.when.called_with(name="non-existent").should.throw(
ClientError
)
# DescribeDomain endpoint
@mock_swf_deprecated
def test_describe_domain():