<s> from django . test . utils import override_settings <EOL> from unittest . mock import patch <EOL> from orchestra . tests . helpers import OrchestraTestCase <EOL> from orchestra . utils . machine_step_scheduler import ( <EOL> AsynchronousMachineStepScheduler ) <EOL> from orchestra . utils . machine_step_scheduler import MachineStepScheduler <EOL> class MachineStepSchedulerTestCase ( OrchestraTestCase ) : <EOL> def setUp ( self ) : <EOL> super ( ) . setUp ( ) <EOL> def test_machine_step_schedule ( self ) : <EOL> scheduler = MachineStepScheduler ( ) <EOL> with self . assertRaises ( NotImplementedError ) : <EOL> scheduler . schedule ( <NUM_LIT:1> , '<STR_LIT>' ) <EOL> @ patch ( '<STR_LIT>' ) <EOL> def test_asynchronous_scheduler ( self , mock_schedule ) : <EOL> scheduler = AsynchronousMachineStepScheduler ( ) <EOL> scheduler . schedule ( <NUM_LIT:1> , '<STR_LIT>' ) <EOL> mock_schedule . assert_called_once_with ( <NUM_LIT:1> , '<STR_LIT>' ) <EOL> @ patch ( '<STR_LIT>' ) <EOL> @ override_settings ( PRODUCTION = True , WORK_QUEUE = None ) <EOL> def test_asynchronous_scheduler_prod ( self , mock_schedule ) : <EOL> scheduler = AsynchronousMachineStepScheduler ( ) <EOL> scheduler . schedule ( <NUM_LIT:1> , '<STR_LIT>' ) <EOL> mock_schedule . assert_called_once_with ( None , '<STR_LIT>' , <NUM_LIT:1> , <EOL> '<STR_LIT>' ) </s>
