<s> import boto <EOL> from boto . swf . exceptions import SWFResponseError <EOL> from moto import mock_swf <EOL> @ mock_swf <EOL> def test_register_activity_type ( ) : <EOL> conn = boto . connect_swf ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_domain ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> types = conn . list_activity_types ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> actype = types [ "<STR_LIT>" ] [ <NUM_LIT:0> ] <EOL> actype [ "<STR_LIT>" ] [ "<STR_LIT:name>" ] . should . equal ( "<STR_LIT>" ) <EOL> actype [ "<STR_LIT>" ] [ "<STR_LIT:version>" ] . should . equal ( "<STR_LIT>" ) <EOL> @ mock_swf <EOL> def test_register_already_existing_activity_type ( ) : <EOL> conn = boto . connect_swf ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_domain ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type . when . called_with ( <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" <EOL> ) . should . throw ( SWFResponseError ) <EOL> @ mock_swf <EOL> def test_register_with_wrong_parameter_type ( ) : <EOL> conn = boto . connect_swf ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_domain ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type . when . called_with ( <EOL> "<STR_LIT>" , "<STR_LIT>" , <NUM_LIT:12> <EOL> ) . should . throw ( SWFResponseError ) <EOL> @ mock_swf <EOL> def test_list_activity_types ( ) : <EOL> conn = boto . connect_swf ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_domain ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> all_activity_types = conn . list_activity_types ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> names = [ activity_type [ "<STR_LIT>" ] [ "<STR_LIT:name>" ] for activity_type in all_activity_types [ "<STR_LIT>" ] ] <EOL> names . should . equal ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> @ mock_swf <EOL> def test_list_activity_types_reverse_order ( ) : <EOL> conn = boto . connect_swf ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_domain ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> all_activity_types = conn . list_activity_types ( "<STR_LIT>" , "<STR_LIT>" , <EOL> reverse_order = True ) <EOL> names = [ activity_type [ "<STR_LIT>" ] [ "<STR_LIT:name>" ] for activity_type in all_activity_types [ "<STR_LIT>" ] ] <EOL> names . should . equal ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> @ mock_swf <EOL> def test_deprecate_activity_type ( ) : <EOL> conn = boto . connect_swf ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_domain ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . deprecate_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> actypes = conn . list_activity_types ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> actype = actypes [ "<STR_LIT>" ] [ <NUM_LIT:0> ] <EOL> actype [ "<STR_LIT>" ] [ "<STR_LIT:name>" ] . should . equal ( "<STR_LIT>" ) <EOL> actype [ "<STR_LIT>" ] [ "<STR_LIT:version>" ] . should . equal ( "<STR_LIT>" ) <EOL> @ mock_swf <EOL> def test_deprecate_already_deprecated_activity_type ( ) : <EOL> conn = boto . connect_swf ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_domain ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . deprecate_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . deprecate_activity_type . when . called_with ( <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" <EOL> ) . should . throw ( SWFResponseError ) <EOL> @ mock_swf <EOL> def test_deprecate_non_existent_activity_type ( ) : <EOL> conn = boto . connect_swf ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_domain ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . deprecate_activity_type . when . called_with ( <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" <EOL> ) . should . throw ( SWFResponseError ) <EOL> @ mock_swf <EOL> def test_describe_activity_type ( ) : <EOL> conn = boto . connect_swf ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_domain ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> task_list = "<STR_LIT:foo>" , default_task_heartbeat_timeout = "<STR_LIT>" ) <EOL> actype = conn . describe_activity_type ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> actype [ "<STR_LIT>" ] [ "<STR_LIT>" ] [ "<STR_LIT:name>" ] . should . equal ( "<STR_LIT:foo>" ) <EOL> infos = actype [ "<STR_LIT>" ] <EOL> infos [ "<STR_LIT>" ] [ "<STR_LIT:name>" ] . should . equal ( "<STR_LIT>" ) <EOL> infos [ "<STR_LIT>" ] [ "<STR_LIT:version>" ] . should . equal ( "<STR_LIT>" ) <EOL> infos [ "<STR_LIT:status>" ] . should . equal ( "<STR_LIT>" ) <EOL> @ mock_swf <EOL> def test_describe_non_existent_activity_type ( ) : <EOL> conn = boto . connect_swf ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . register_domain ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> conn . describe_activity_type . when . called_with ( <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" <EOL> ) . should . throw ( SWFResponseError ) </s>
