Beispiel #1
0
 def setUp(self):
     super(FanInMergeJoinDispatchTest, self).setUp()
     setUpByString(self, FAN_IN_MACHINE, machineName='FanInMachine', instanceName='foo')
     mock('config.currentConfiguration', returns=self.currentConfig, tracker=None)
     for i in range(20):
         SimpleModel(key_name='%d' % i).put()
     memcache.set('calls', 0)
     memcache.set('raise', False)
     
     context = self.factory.createFSMInstance(self.machineConfig.name, instanceName='foo')
     context[constants.STEPS_PARAM] = 1
     obj = TemporaryStateObject()
     obj[constants.TASK_NAME_PARAM] = 'taskName'
     obj[constants.RETRY_COUNT_PARAM] = 0
     
     self.context = None
     self.obj = None
     
     random.seed(0)
     context.dispatch('pseudo-init', obj) # write down a work package
     self.index = context[constants.INDEX_PARAM]
     
     self.assertEqual(1, _FantasmFanIn.all().count())
     self.assertEqual('foo--InitialState--ok--FanInState--step-2-2957927341', 
                      _FantasmFanIn.all().get().workIndex)
Beispiel #2
0
    def setUp(self):
        super(FanInMergeJoinDispatchTest, self).setUp()
        setUpByString(self,
                      FAN_IN_MACHINE,
                      machineName='FanInMachine',
                      instanceName='foo')
        mock('config.currentConfiguration',
             returns=self.currentConfig,
             tracker=None)
        for i in range(20):
            SimpleModel(key_name='%d' % i).put()
        memcache.set('calls', 0)
        memcache.set('raise', False)

        context = self.factory.createFSMInstance(self.machineConfig.name,
                                                 instanceName='foo')
        context[constants.STEPS_PARAM] = 1
        obj = TemporaryStateObject()
        obj[constants.TASK_NAME_PARAM] = 'taskName'
        obj[constants.RETRY_COUNT_PARAM] = 0

        self.context = None
        self.obj = None

        random.seed(0)
        context.dispatch('pseudo-init', obj)  # write down a work package
        self.index = context[constants.INDEX_PARAM]

        self.assertEqual(1, _FantasmFanIn.all().count())
        self.assertEqual(
            'foo--InitialState--ok--FanInState--step-2-2957927341',
            _FantasmFanIn.all().get().workIndex)
Beispiel #3
0
 def setUp(self):
     super(FanInTxnException, self).setUp()
     setUpByString(self, FAN_IN_MACHINE, machineName='FanInMachine')
     mock('config.currentConfiguration', returns=self.currentConfig, tracker=None)
     for i in range(20):
         SimpleModel(key_name='%d' % i).put()
     memcache.set('calls', 0)
     memcache.set('raise', True)
 def setUp(self):
     super(BaseTest, self).setUp()
     setUpByString(self, FAN_IN_MACHINE, machineName=self.MACHINE_NAME)
     mock('config.currentConfiguration', returns=self.currentConfig, tracker=None)
     mock('FSMFanInCleanupHandler.post', returns=None, tracker=None)
     for i in range(10):
         ContinuationFanInModel(value=i).put()
     self.context['event'] = self.EVENT
Beispiel #5
0
 def setUp(self):
     super(FanInQueueDispatchTest, self).setUp()
     setUpByString(self, FAN_IN_MACHINE, machineName='FanInMachine', instanceName='foo')
     mock('config.currentConfiguration', returns=self.currentConfig, tracker=None)
     for i in range(20):
         SimpleModel(key_name='%d' % i).put()
     FanInAction.CALLS = 0
     self.context = None
     self.obj = None
Beispiel #6
0
 def setUp(self):
     super(FanInTxnException, self).setUp()
     setUpByString(self, FAN_IN_MACHINE, machineName='FanInMachine')
     mock('config.currentConfiguration',
          returns=self.currentConfig,
          tracker=None)
     for i in range(20):
         SimpleModel(key_name='%d' % i).put()
     memcache.set('calls', 0)
     memcache.set('raise', True)
Beispiel #7
0
 def setUp(self):
     super(BaseTest, self).setUp()
     setUpByString(self, FAN_IN_MACHINE, machineName=self.MACHINE_NAME)
     mock('config.currentConfiguration',
          returns=self.currentConfig,
          tracker=None)
     mock('FSMFanInCleanupHandler.post', returns=None, tracker=None)
     for i in range(10):
         ContinuationFanInModel(value=i).put()
     self.context['event'] = self.EVENT
Beispiel #8
0
 def setUp(self):
     super(FanInQueueDispatchTest, self).setUp()
     setUpByString(self,
                   FAN_IN_MACHINE,
                   machineName='FanInMachine',
                   instanceName='foo')
     mock('config.currentConfiguration',
          returns=self.currentConfig,
          tracker=None)
     for i in range(20):
         SimpleModel(key_name='%d' % i).put()
     FanInAction.CALLS = 0
     self.context = None
     self.obj = None
Beispiel #9
0
 def setUp(self):
     super(TaskDoubleExecutionTest, self).setUp()
     setUpByString(self, SIMPLE_MACHINE, machineName='SimpleMachine')
     mock('config.currentConfiguration',
          returns=self.currentConfig,
          tracker=None)
Beispiel #10
0
 def setUp(self):
     super(TaskDoubleExecutionTest, self).setUp()
     setUpByString(self, SIMPLE_MACHINE, machineName='SimpleMachine')
     mock('config.currentConfiguration', returns=self.currentConfig, tracker=None)