def test_call_insights_recommender_npm(self, mock_get, mock_post): """Test if the correct service is called for the correct ecosystem.""" with app.app_context(): # Test whether the correct service is called for NPM. called_url_json = RecommendationTask.call_insights_recommender([{ "ecosystem": "npm" }]) self.assertTrue('npm-insights' in called_url_json['url']) # Now test whether the correct service is called for maven. called_url_json = RecommendationTask.call_insights_recommender([{ "ecosystem": "maven" }]) self.assertTrue('pgm' in called_url_json['url'])
def test_retrieve_worker_result_2(_a, _b, _c): """Test the function retrieve_worker_result.""" with app.app_context(): response = retrieve_worker_result("test", "test") assert response == 1