Reorganize SWF tests so they're shorter and easier to use
This commit is contained in:
parent
a713005882
commit
eadc07bf61
14 changed files with 180 additions and 168 deletions
29
tests/test_swf/models/test_domain.py
Normal file
29
tests/test_swf/models/test_domain.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
from sure import expect
|
||||
|
||||
from moto.swf.models import Domain
|
||||
|
||||
|
||||
def test_domain_short_dict_representation():
|
||||
domain = Domain("foo", "52")
|
||||
domain.to_short_dict().should.equal({"name":"foo", "status":"REGISTERED"})
|
||||
|
||||
domain.description = "foo bar"
|
||||
domain.to_short_dict()["description"].should.equal("foo bar")
|
||||
|
||||
def test_domain_full_dict_representation():
|
||||
domain = Domain("foo", "52")
|
||||
|
||||
domain.to_full_dict()["domainInfo"].should.equal(domain.to_short_dict())
|
||||
_config = domain.to_full_dict()["configuration"]
|
||||
_config["workflowExecutionRetentionPeriodInDays"].should.equal("52")
|
||||
|
||||
def test_domain_string_representation():
|
||||
domain = Domain("my-domain", "60")
|
||||
str(domain).should.equal("Domain(name: my-domain, status: REGISTERED)")
|
||||
|
||||
def test_domain_add_to_task_list():
|
||||
domain = Domain("my-domain", "60")
|
||||
domain.add_to_task_list("foo", "bar")
|
||||
dict(domain.task_lists).should.equal({
|
||||
"foo": ["bar"]
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue