def test_other_queries(self): endpoint_cache = Endpoint("mock") endpoint_cache.create_cache() results = endpoint_cache.query_cache('Aspirin', 'brand_name', ['product_ndc', 'dosage_form']) self.assertEqual(results[0]['product_ndc'], '0615-8058') self.assertEqual(results[1]['dosage_form'], 'TABLET, COATED')
def test_part_4_look_up_all_product_ndc_for_ingredients(self): # TODO: Complete test by adding call to look up the 'product_ndc' for the drugs which have # `CLOPIDOGREL BISULFATE` as an 'active_ingredients' # Example: lookup_method('CLOPIDOGREL BISULFATE', 'active_ingredients', ['product_ndc']) endpoint_cache = Endpoint("mock") endpoint_cache.create_cache() results = endpoint_cache.query_cache('CLOPIDOGREL BISULFATE', 'active_ingredients', ['product_ndc']) self.assertEqual(results[0]['product_ndc'], '21695-665')
def test_part_4_look_up_active_ingredients_for_product_ndc(self): # TODO: Complete test by adding call to look up the 'active_ingredients' for the product_ndc: '21695-665' # Example lookup_method('21695-665', 'product_ndc', ['active_ingredients']) endpoint_cache = Endpoint("mock") endpoint_cache.create_cache() results = endpoint_cache.query_cache('21695-665', 'product_ndc', ['active_ingredients']) self.assertEqual(results[0]['active_ingredients'], [{ "strength": "75 mg/1", "name": "CLOPIDOGREL BISULFATE" }])