def test_adding_nidm(self):
        Image2 = StatisticMap(name='Image2', collection=self.Collection1, file='beta_0001.nii.gz', map_type="Other")
        Image2.file = SimpleUploadedFile('beta_0001.nii.gz', file(os.path.join(self.test_path,'test_data/statmaps/beta_0001.nii.gz')).read())
        Image2.save()
        
        zip_file = open(os.path.join(self.test_path,'test_data/nidm/spm_example.nidm.zip'), 'rb')
        post_dict = {
            'name': 'spm_nidm',
            'description':'{0} upload test'.format('spm_example'),
            'collection':self.Collection2.pk}
        fname = os.path.basename(os.path.join(self.test_path,'test_data/nidm/spm_example.nidm.zip'))
        file_dict = {'zip_file': SimpleUploadedFile(fname, zip_file.read())}
        zip_file.close()
        form = NIDMResultsForm(post_dict, file_dict)
        # Transforms should be generated synchronously
        nidm = form.save()
        print "\nTesting Counter - added nidm result ###"

        # We should have 2 images total, so 1 comparison
        total_comparisons = count_existing_comparisons(Image2.pk)
        self.assertEqual(total_comparisons,1)
        
        #Let's add a single subject map - this should not trigger a comparison
        Image2ss = StatisticMap(name='Image2 - single subject', collection=self.Collection3, file='beta_0001.nii.gz', map_type="Other", analysis_level='S')
        Image2ss.file = SimpleUploadedFile('beta_0001.nii.gz', file(os.path.join(self.test_path,'test_data/statmaps/beta_0001.nii.gz')).read())
        Image2ss.save()
        total_comparisons = count_existing_comparisons(Image2ss.pk)
        self.assertEqual(total_comparisons,0)

        # Make sure comparisons were calculated
        number_comparisons = len(Comparison.objects.all())
        print "\n %s comparisons exist after adding NIDM `[should not be 0]" %(number_comparisons)
        self.assertEqual(0 > number_comparisons,True)
dataset/ETHPy150Open NeuroVault/NeuroVault/neurovault/apps/statmaps/tests/test_counter.py/Test_Counter.test_adding_nidm/swapped operands of `>`