<s> import boto . swf . layer2 <EOL> from boto . swf . layer2 import ActivityType , WorkflowType , WorkflowExecution <EOL> from tests . unit import unittest <EOL> from mock import Mock , ANY <EOL> class TestTypes ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> boto . swf . layer2 . Layer1 = Mock ( ) <EOL> def test_workflow_type_register_defaults ( self ) : <EOL> wf_type = WorkflowType ( name = '<STR_LIT:name>' , domain = '<STR_LIT:test>' , version = '<STR_LIT:1>' ) <EOL> wf_type . register ( ) <EOL> wf_type . _swf . register_workflow_type . assert_called_with ( '<STR_LIT:test>' , '<STR_LIT:name>' , '<STR_LIT:1>' , <EOL> default_execution_start_to_close_timeout = ANY , <EOL> default_task_start_to_close_timeout = ANY , <EOL> default_child_policy = ANY <EOL> ) <EOL> def test_activity_type_register_defaults ( self ) : <EOL> act_type = ActivityType ( name = '<STR_LIT:name>' , domain = '<STR_LIT:test>' , version = '<STR_LIT:1>' ) <EOL> act_type . register ( ) <EOL> act_type . _swf . register_activity_type . assert_called_with ( '<STR_LIT:test>' , '<STR_LIT:name>' , '<STR_LIT:1>' , <EOL> default_task_heartbeat_timeout = ANY , <EOL> default_task_schedule_to_close_timeout = ANY , <EOL> default_task_schedule_to_start_timeout = ANY , <EOL> default_task_start_to_close_timeout = ANY <EOL> ) <EOL> def test_workflow_type_start_execution ( self ) : <EOL> wf_type = WorkflowType ( name = '<STR_LIT:name>' , domain = '<STR_LIT:test>' , version = '<STR_LIT:1>' ) <EOL> run_id = '<STR_LIT>' <EOL> wf_type . _swf . start_workflow_execution . return_value = { '<STR_LIT>' : run_id } <EOL> execution = wf_type . start ( task_list = '<STR_LIT>' ) <EOL> self . assertIsInstance ( execution , WorkflowExecution ) <EOL> self . assertEquals ( wf_type . name , execution . name ) <EOL> self . assertEquals ( wf_type . version , execution . version ) <EOL> self . assertEquals ( run_id , execution . runId ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
