def test_client_food_report_warning(self, apimock): cli = UsdaClient("API_KAY") with apimock: with pytest.warns(UserWarning, match='received a basic report'): fr = cli.get_food_report( 123456, report_type=UsdaNdbReportType.full, ) assert fr.food.name == "Pizza" assert fr.report_type == UsdaNdbReportType.basic
def test_client_food_report(self, apimock): cli = UsdaClient("API_KAY") with apimock: fr = cli.get_food_report(123456) assert fr.food.name == "Pizza"