def test_runinfojson_norundone(self): request = testing.DummyRequest() job = self.fake_job() job.db.runInfo.return_value = None views = JobViews(job, request) response = views.runinfojson() self.assertEqual( response, { 'success': True, 'data': dict( ms_data_area='', ms_data_format='mzxml', ionisation_mode=1, ms_intensity_cutoff=0.0, msms_intensity_cutoff=5, mz_precision=5.0, mz_precision_abs=0.001, abs_peak_cutoff=5000, max_ms_level=10, precursor_mz_precision=0.005, max_broken_bonds=3, max_water_losses=1, ) })
def test_runinfojson(self): request = testing.DummyRequest() job = self.fake_job() from magmaweb.models import Run job.db.runInfo.return_value = Run( ionisation_mode=-1, skip_fragmentation=True, ms_intensity_cutoff=200000.0, msms_intensity_cutoff=50, mz_precision=4.0, mz_precision_abs=0.002, use_all_peaks=True, ms_filename='F123456.mzxml', abs_peak_cutoff=1000, max_ms_level=3, precursor_mz_precision=0.01, max_broken_bonds=4, description='My first description', max_water_losses=1, ) views = JobViews(job, request) response = views.runinfojson() self.assertEqual( response, { 'success': True, 'data': dict( ms_data_area='', ms_data_format='mzxml', ionisation_mode=-1, ms_intensity_cutoff=200000.0, msms_intensity_cutoff=50, mz_precision=4.0, mz_precision_abs=0.002, abs_peak_cutoff=1000, max_ms_level=3, precursor_mz_precision=0.01, max_broken_bonds=4, max_water_losses=1, ) })