Slide 23
Slide 23 text
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda関数実装 Unit Test例
23
@pytest.fixture()
def placed():
return [{'id': '22', 'name': 'Tea', 'yen': Decimal('120')},
{'id': '24', 'name': 'Cola', 'yen': Decimal('150')},
{'id': '27', 'name': ‘Coffee', 'yen': Decimal('300’)}]
def test_calc(placed, mocker):
ret = app.calc(placed)
assert ret == Decimal(5.19)
合計金額
https://docs.pytest.org/