Created
August 19, 2022 21:05
-
-
Save Z4HRA-S/0f87d540da23e179c4391ce428fd3793 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
class TestMain(unittest.TestCase): | |
def test_sold_product_percent(self): | |
# Arrange | |
session = mock.Mock() | |
session.query().group_by().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