Esempio n. 1
0
 def test_iodp_jr6_with_magfile(self):
     options = {}
     input_dir = os.path.join(WD, 'data_files', 'Measurement_Import',
                              'IODP_jr6_magic')
     options['input_dir_path'] = input_dir
     mag_file = 'test.jr6'
     options['mag_file'] = 'test.jr6'
     meas_file = 'test.magic'
     options['meas_file'] = meas_file
     program_ran, outfile = iodp_jr6_magic.main(False, **options)
     self.assertTrue(program_ran)
     self.assertEqual(outfile, os.path.join('.', meas_file))
Esempio n. 2
0
 def test_iodp_jr6_with_magfile(self):
     options = {}
     input_dir = os.path.join(WD, 'data_files', 'Measurement_Import',
                              'IODP_jr6_magic')
     options['input_dir_path'] = input_dir
     mag_file = 'test.jr6'
     options['mag_file'] = 'test.jr6'
     meas_file = 'test.magic'
     options['meas_file'] = meas_file
     program_ran, outfile = iodp_jr6_magic.main(False, **options)
     self.assertTrue(program_ran)
     self.assertEqual(outfile, os.path.join('.', meas_file))
Esempio n. 3
0
 def test_iodp_jr6_with_magfile_but_hidden_sampfile(self):
     options = {}
     input_dir = os.path.join(WD, 'data_files', 'Measurement_Import',
                              'IODP_jr6_magic')
     samp_file = os.path.join(input_dir, 'er_samples.txt')
     hidden_samp_file = os.path.join(input_dir, 'hidden_er_samples.txt')
     os.rename(samp_file, hidden_samp_file)
     options['input_dir_path'] = input_dir
     mag_file = 'test.jr6'
     options['mag_file'] = mag_file
     program_ran, error_message = iodp_jr6_magic.main(False, **options)
     msg = "Your input directory:\n{}\nmust contain an er_samples.txt file, or you must explicitly provide one".format(input_dir)
     self.assertFalse(program_ran)
     self.assertEqual(error_message, msg)
     os.rename(hidden_samp_file, samp_file)
Esempio n. 4
0
 def test_iodp_jr6_with_magfile_but_hidden_sampfile(self):
     options = {}
     input_dir = os.path.join(WD, 'data_files', 'Measurement_Import',
                              'IODP_jr6_magic')
     samp_file = os.path.join(input_dir, 'er_samples.txt')
     hidden_samp_file = os.path.join(input_dir, 'hidden_er_samples.txt')
     os.rename(samp_file, hidden_samp_file)
     options['input_dir_path'] = input_dir
     mag_file = 'test.jr6'
     options['mag_file'] = mag_file
     program_ran, error_message = iodp_jr6_magic.main(False, **options)
     msg = "Your input directory:\n{}\nmust contain an er_samples.txt file, or you must explicitly provide one".format(
         input_dir)
     self.assertFalse(program_ran)
     self.assertEqual(error_message, msg)
     os.rename(hidden_samp_file, samp_file)
Esempio n. 5
0
 def test_iodp_jr6_with_no_files(self):
     options = {}
     program_ran, error_message = iodp_jr6_magic.main(False, **options)
     self.assertFalse(program_ran)
     self.assertEqual(error_message, "You must provide an IODP_jr6 format file")
Esempio n. 6
0
 def test_iodp_jr6_with_no_files(self):
     options = {}
     program_ran, error_message = iodp_jr6_magic.main(False, **options)
     self.assertFalse(program_ran)
     self.assertEqual(error_message,
                      "You must provide an IODP_jr6 format file")