Created
August 19, 2022 19:47
-
-
Save Z4HRA-S/eb696e9103de1332cdbf06bec7ba527f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_decoupled_sold_product_percent(self): | |
# Arrange | |
session = mock.Mock() | |
session.query.return_value = session | |
session.filter.return_value = session | |
session.where.return_value = session | |
session.group_by.return_value = session | |
session.all.return_value = [(76, 'cheese_cake'), | |
(67, 'chocolate_cake'), | |
(70, 'coffee'), | |
(17, 'hot_dog'), | |
(70, 'tea')] | |
# Act | |
output = sold_product_percent(session) | |
# Assert | |
assert type(output) == dict | |
assert 99 < sum(output.values()) < 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment