def testGoWithScannbaleFromLastScan(self): scannable = Mock() sdp = ScanDataProcessor([], {}, scanDataPointCache=self.sdpc) sdp.last_scannable_scanned = scannable sdp.go(1) scannable.moveTo.assert_called_with(1) sdp.go([1]) scannable.moveTo.assert_called_with([1]) sdp.go([1,2]) scannable.moveTo.assert_called_with([1, 2])
def testPrepareForScanDisablesGo(self): sdp = ScanDataProcessor([MaxPositionAndValue(), MinPositionAndValue()], {}, raiseProcessorExceptions=True, scanDataPointCache=self.sdpc) sdp.last_scannable_scanned = self.x sdp.prepareForScan() self.assertRaises(Exception, sdp.go, 3)