def test_mspectrajson(self): request = testing.DummyRequest(matchdict={'scanid': 641}) job = self.fake_job() views = JobViews(job, request) views.mspectrajson() job.db.mspectra.assert_called_with(641, None)
def test_mspectrajson_withmslevel(self): request = testing.DummyRequest(matchdict={'scanid': 641}, params={'mslevel': 3}) job = self.fake_job() views = JobViews(job, request) views.mspectrajson() job.db.mspectra.assert_called_with(641, 3)
def test_mspectra_withoutscanid_notfound(self): from magmaweb.job import ScanNotFound request = testing.DummyRequest(matchdict={'scanid': 641}) job = self.fake_job() job.db.mspectra.side_effect = ScanNotFound() views = JobViews(job, request) from pyramid.httpexceptions import HTTPNotFound with self.assertRaises(HTTPNotFound): views.mspectrajson()