def test(self):    
     # Define the files we'll be making    
     testProjectName = 'test_project.ilp'
     # Clean up: Remove the test data files we created last time (just in case)
     for f in [testProjectName]:
         try:
             os.remove(f)
         except:
             pass
 
     # Create an empty project
     with h5py.File(testProjectName) as testProject:
         testProject.create_dataset("ilastikVersion", data=0.6)
         
         # Create an operator to work with and give it some input
         g = Graph()
         op = OpMockPixelClassifier(graph=g)
         operatorToSave = op
         serializer = PixelClassificationSerializer(operatorToSave, 'PixelClassificationTest')
         
         op.LabelInputs.resize( 1 )
 
         # Create some labels
         labeldata = numpy.zeros(op.dataShape)
         labeldata[:,:,0:5,:,:] = 1
         labeldata[:,:,50:60,:] = 2
 
         # Slice them into our operator
         op.LabelInputs[0][0:1, 0:10, 0:5,   0:100, 0:1] = labeldata[:,:,0:5,:,:]
         op.LabelInputs[0][0:1, 0:10, 50:60, 0:100, 0:1] = labeldata[:,:,50:60,:,:]
         
         # Simulate the predictions changing by setting the prediction output dirty
         op.PredictionProbabilities[0].setDirty(slice(None))
 
         # Enable prediction storage
         serializer.predictionStorageEnabled = True
             
         # Serialize!
         serializer.serializeToHdf5(testProject, testProjectName)
 
         # Check that the prediction data was written to the file
         assert (testProject['PixelClassificationTest/Predictions/predictions0000'][...] == op.PredictionProbabilities[0][...].wait()).all()
         
         # Deserialize into a fresh operator
         operatorToLoad = OpMockPixelClassifier(graph=g)
         deserializer = PixelClassificationSerializer(operatorToLoad, 'PixelClassificationTest')
         deserializer.deserializeFromHdf5(testProject, testProjectName)
 
         # Did the data go in and out of the file without problems?
         assert len(operatorToLoad.LabelImages) == 1
         assert (operatorToSave.LabelImages[0][...].wait() == operatorToLoad.LabelImages[0][...].wait()).all()
         assert (operatorToSave.LabelImages[0][...].wait() == labeldata[...]).all()
     
     os.remove(testProjectName)