def test_moleculessdf_somecols(self): job = self.fake_job() job.db.molecules2sdf.return_value = 'bla' request = testing.DummyRequest(params={ 'start': 0, 'limit': 10, 'cols': '["name","score"]' }) views = JobViews(job, request) views.moleculesjson = Mock(return_value={'rows': []}) views.moleculessdf() job.db.molecules2sdf.assert_called_with([], cols=['name', 'score'])
def test_moleculessdf(self): job = self.fake_job() job.db.molecules2sdf.return_value = 'bla' request = testing.DummyRequest(params={'start': 0, 'limit': 10}) views = JobViews(job, request) views.moleculesjson = Mock(return_value={'rows': []}) response = views.moleculessdf() job.db.molecules2sdf.assert_called_with([], cols=[]) self.assertEqual(response.content_type, 'chemical/x-mdl-sdfile') self.assertEqual(response.body, 'bla')