def test_should_return_non_existent_disease(self, mock_search, mock_redis): mock_search.return_value = MockQuery(None) request = testing.DummyRequest() request.context = testing.DummyResource() request.matchdict['id'] = "DOID:574" response = disease(request) self.assertEqual(response.status_code, 404)
def test_should_return_non_existent_complex(self, mock_search, mock_redis): mock_search.return_value = MockQuery(None) request = testing.DummyRequest() request.context = testing.DummyResource() request.matchdict['id'] = 'nonexistent_id' response = complex(request) self.assertEqual(response.get('complex_name'), None)
def test_should_return_non_existent_locus(self, mock_search, mock_redis): mock_search.return_value = MockQuery(None) request = testing.DummyRequest() request.context = testing.DummyResource() id = mock_redis.extract_id_request(request, 'locus', param_name='id') response = locus(request) self.assertEqual(response.status_code, 404)
def test_should_return_non_existent_observable_ontology_graph( self, mock_search, mock_redis): mock_search.return_value = MockQuery(None) request = testing.DummyRequest() request.context = testing.DummyResource() #request.matchdict['id'] = "169841" id = mock_redis.extract_id_request(request, 'observable', param_name='id') response = observable_ontology_graph(request) self.assertEqual(response.status_code, 404)
def test_should_return_valid_reserved_name(self, mock_search, mock_redis): r_name = factory.ReservednameFactory() mock_search.return_value = MockQuery(r_name) request = testing.DummyRequest() request.context = testing.DummyResource() #request.matchdict['id'] = r_name.format_name id = mock_redis.extract_id_request(request, 'reservedname', param_name='id') response = reserved_name(request) self.assertEqual(response, r_name.to_dict())