def test_Detector_pickle(self):
    det = self.ai.detector
    dets = dumps(det)
    self.assert_(dets, 'pickle works')
    rest = loads(dets)
    self.assert_(rest, 'unpickle works')
    self.assertEqual(rest.shape, self.ai.detector.MAX_SHAPE)
    mar = detector_factory('RayonixMx225')
    mar.guess_binning((2048, 2048))
    self.assertEqual(mar.binning, (3, 3), 'binning OK')
    mars = dumps(mar)
    marr = loads(mars)
    self.assertEqual(mar.binning, marr.binning, 'restored binning OK')
def test_Detector_pickle(self):
    det = self.ai.detector
    dets = dumps(det)
    self.assert_(dets, 'pickle works')
    rest = loads(dets)
    self.assert_(rest, 'unpickle works')
    self.assertEqual(rest.shape, self.ai.detector.MAX_SHAPE)
    mar = detector_factory('RayonixMx225')
    mar.guess_binning((2048, 2048))
    self.assertEqual(mar.binning, (3, 3), 'binning OK')
    mars = dumps(mar)
    marr = loads(mars)
    self.assertEqual(mar.binning, marr.binning, 'restored binning OK')