def test_fragments_filteronmslevel(self): request = testing.DummyRequest(matchdict={ 'molid': 72, 'scanid': 641 }, params={'node': 1709}) job = self.fake_job() views = JobViews(job, request) views.fragments() job.db.fragments.assert_called_with(molid=72, scanid=641, node=1709)
def test_fragments_moleculewithoutfragments(self): request = testing.DummyRequest(matchdict={ 'molid': 72, 'scanid': 641 }, params={'node': ''}) job = self.fake_job() views = JobViews(job, request) views.fragments() job.db.fragments.assert_called_with(molid=72, scanid=641, node='')
def test_fragments_badmolecule_notfound(self): from magmaweb.job import FragmentNotFound request = testing.DummyRequest(matchdict={ 'molid': 72, 'scanid': 641 }, params={'node': ''}) job = self.fake_job() job.db.fragments.side_effect = FragmentNotFound views = JobViews(job, request) from pyramid.httpexceptions import HTTPNotFound with self.assertRaises(HTTPNotFound): views.fragments()