示例#1
0
 def test_sio_magic_success_with_wd(self):
     options = {}
     dir_path = os.path.join('data_files', 'Measurement_Import',
                             'sio_magic')
     options['mag_file'] = os.path.join('sio_af_example.dat')
     options['meas_file'] = os.path.join('sio_af_example.magic')
     options['dir_path'] = dir_path
     program_ran, file_name = sio_magic.convert(**options)
     self.assertTrue(program_ran)
     self.assertEqual(os.path.realpath(file_name),
                      os.path.realpath(os.path.join(dir_path, options['meas_file'])))
示例#2
0
 def test_sio_magic_fail_with_coil(self):
     options = {}
     options['mag_file'] = os.path.join(WD, 'data_files',
                                        'Measurement_Import', 'sio_magic',
                                        'sio_af_example.dat')
     meas_file = os.path.join(WD, 'data_files', 'Measurement_Import',
                              'sio_magic', 'sio_af_example.magic')
     options['meas_file'] = meas_file
     options['coil'] = 4
     program_ran, error_message = sio_magic.convert(**options)
     self.assertFalse(program_ran)
     self.assertEqual(error_message, '4 is not a valid coil specification')
示例#3
0
 def test_sio_magic_succeed_option4(self):
     options = {}
     options['mag_file'] = os.path.join(WD, 'data_files',
                                        'Measurement_Import', 'sio_magic',
                                        'sio_af_example.dat')
     meas_file = os.path.join(WD, 'data_files', 'Measurement_Import',
                              'sio_magic', 'sio_af_example.magic')
     options['meas_file'] = meas_file
     options['samp_con'] = '4-2'
     program_ran, file_name = sio_magic.convert(**options)
     self.assertTrue(program_ran)
     self.assertEqual(file_name, meas_file)
示例#4
0
 def test_sio_magic_fail_option4(self):
     options = {}
     options['mag_file'] = os.path.join(WD, 'data_files',
                                        'Measurement_Import', 'sio_magic',
                                        'sio_af_example.dat')
     meas_file = os.path.join(WD, 'data_files', 'Measurement_Import',
                              'sio_magic', 'sio_af_example.magic')
     options['meas_file'] = meas_file
     options['samp_con'] = '4'
     program_ran, error_message = sio_magic.convert(**options)
     self.assertFalse(program_ran)
     self.assertEqual(error_message, "naming convention option [4] must be in form 4-Z where Z is an integer")
示例#5
0
 def test_sio_magic_fail_with_coil(self):
     options = {}
     options['mag_file'] = os.path.join(WD, 'data_files',
                                        'Measurement_Import', 'sio_magic',
                                        'sio_af_example.dat')
     meas_file = os.path.join(WD, 'data_files', 'Measurement_Import',
                              'sio_magic', 'sio_af_example.magic')
     options['meas_file'] = meas_file
     options['coil'] = 4
     program_ran, error_message = sio_magic.convert(**options)
     self.assertFalse(program_ran)
     self.assertEqual(error_message, '4 is not a valid coil specification')
示例#6
0
 def test_sio_magic_succeed_option4(self):
     options = {}
     options['mag_file'] = os.path.join(WD, 'data_files',
                                        'Measurement_Import', 'sio_magic',
                                        'sio_af_example.dat')
     meas_file = os.path.join(WD, 'data_files', 'Measurement_Import',
                              'sio_magic', 'sio_af_example.magic')
     options['meas_file'] = meas_file
     options['samp_con'] = '4-2'
     program_ran, file_name = sio_magic.convert(**options)
     self.assertTrue(program_ran)
     self.assertEqual(file_name, meas_file)
示例#7
0
 def test_sio_magic_success_with_wd(self):
     options = {}
     dir_path = os.path.join('data_files', 'Measurement_Import',
                             'sio_magic')
     options['mag_file'] = os.path.join('sio_af_example.dat')
     options['meas_file'] = os.path.join('sio_af_example.magic')
     options['dir_path'] = dir_path
     program_ran, file_name = sio_magic.convert(**options)
     self.assertTrue(program_ran)
     self.assertEqual(
         os.path.realpath(file_name),
         os.path.realpath(os.path.join(dir_path, options['meas_file'])))
示例#8
0
 def test_sio_magic_success(self):
     options = {}
     dir_path = os.path.join('data_files', 'Measurement_Import',
                             'sio_magic')
     options['mag_file'] = os.path.join(dir_path, 'sio_af_example.dat')
     options['meas_file'] = os.path.join(dir_path, 'sio_af_example.magic')
     program_ran, file_name = sio_magic.convert(**options)
     self.assertTrue(program_ran)
     self.assertEqual(os.path.realpath(file_name),
                      os.path.realpath(options['meas_file']))
     meas_df = nb.MagicDataFrame(options['meas_file'])
     self.assertIn('sequence', meas_df.df.columns)
     self.assertEqual(0, meas_df.df.iloc[0]['sequence'])
示例#9
0
 def test_sio_magic_success(self):
     options = {}
     dir_path = os.path.join('data_files', 'Measurement_Import',
                             'sio_magic')
     options['mag_file'] = os.path.join(dir_path, 'sio_af_example.dat')
     options['meas_file'] = os.path.join(dir_path, 'sio_af_example.magic')
     program_ran, file_name = sio_magic.convert(**options)
     self.assertTrue(program_ran)
     self.assertEqual(os.path.realpath(file_name),
                      os.path.realpath(options['meas_file']))
     meas_df = nb.MagicDataFrame(options['meas_file'])
     self.assertIn('sequence', meas_df.df.columns)
     self.assertEqual(0, meas_df.df.iloc[0]['sequence'])
示例#10
0
 def test_sio_magic_fail_option4(self):
     options = {}
     options['mag_file'] = os.path.join(WD, 'data_files',
                                        'Measurement_Import', 'sio_magic',
                                        'sio_af_example.dat')
     meas_file = os.path.join(WD, 'data_files', 'Measurement_Import',
                              'sio_magic', 'sio_af_example.magic')
     options['meas_file'] = meas_file
     options['samp_con'] = '4'
     program_ran, error_message = sio_magic.convert(**options)
     self.assertFalse(program_ran)
     self.assertEqual(
         error_message,
         "naming convention option [4] must be in form 4-Z where Z is an integer"
     )
示例#11
0
 def test_sio_magic_no_files(self):
     program_ran, error_message = sio_magic.convert()
     self.assertFalse(program_ran)
     self.assertEqual(error_message, 'mag_file field is required option')
示例#12
0
 def test_sio_magic_no_files(self):
     program_ran, error_message = sio_magic.convert()
     self.assertFalse(program_ran)
     self.assertEqual(error_message, 'mag_file field is required option')