示例#1
0
 def setUp(self):
     BinTestCase.setUp(self)
     # Set the startSide to the left so it knows that the routine started
     # on the left side
     self.ai.data['startSide'] = randombin.BinSortingState.LEFT
     self.ai.data['binData'] = dict()
     randombin.ensureBinTracking(self.qeventHub, self.ai)
     
     self.ai.data['binData']['currentID'] = 4
     self.ai.data['binData']['currentIds'] = set([3,4])
     self.ai.data['binData']['itemData'] = {4 : Mock(x = -1), 3 : Mock(x = 0)}
     self.machine.start(randombin.NextBin)
     self.qeventHub.publishEvents()
     assert type(self.machine.currentState()) == randombin.NextBin
     
     self._centered = False
     self._atEnd = False
     self.qeventHub.subscribeToType(randombin.NextBin.CENTERED_, self._centeredH)
     self.qeventHub.subscribeToType(randombin.NextBin.AT_END, self._atEndH)
示例#2
0
    def setUp(self):
        BinTestCase.setUp(self)
        # Set the startSide to the left so it knows that the routine started
        # on the left side
        self.ai.data['startSide'] = randombin.BinSortingState.LEFT
        self.ai.data['binData'] = dict()
        randombin.ensureBinTracking(self.qeventHub, self.ai)

        self.ai.data['binData']['currentID'] = 4
        self.ai.data['binData']['currentIds'] = set([3, 4])
        self.ai.data['binData']['itemData'] = {4: Mock(x=-1), 3: Mock(x=0)}
        self.machine.start(randombin.NextBin)
        self.qeventHub.publishEvents()
        assert type(self.machine.currentState()) == randombin.NextBin

        self._centered = False
        self._atEnd = False
        self.qeventHub.subscribeToType(randombin.NextBin.CENTERED_,
                                       self._centeredH)
        self.qeventHub.subscribeToType(randombin.NextBin.AT_END, self._atEndH)
示例#3
0
 def testBinFoundDropped(self):
     randombin.ensureBinTracking(self.qeventHub, self.ai)
     self.binTrackingHelper()
示例#4
0
 def testEnsureBinTracking(self):
     randombin.ensureBinTracking(self.qeventHub, self.ai)
     self.assertDataValue(self.ai.data['binData'], 'trackingEnabled', True)
示例#5
0
 def testBinFoundDropped(self):
     randombin.ensureBinTracking(self.qeventHub, self.ai)
     self.binTrackingHelper()
示例#6
0
 def testEnsureBinTracking(self):
     randombin.ensureBinTracking(self.qeventHub, self.ai)
     self.assertDataValue(self.ai.data['binData'], 'trackingEnabled', True)