示例#1
0
 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
示例#2
0
 def test_client_food_report(self, apimock):
     cli = UsdaClient("API_KAY")
     with apimock:
         fr = cli.get_food_report(123456)
     assert fr.food.name == "Pizza"