예제 #1
0
파일: test_views.py 프로젝트: wangjs/MAGMa
    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'])
예제 #2
0
파일: test_views.py 프로젝트: wangjs/MAGMa
    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')