bro
This commit is contained in:
1 parent
de41a02749
commit
9af09cebd3
764 files changed
+54218
-78859
No files matched your search
@@ -0,0 +1,21 @@
|
||||
from calorie_counting import parse, group_sums, max_calories, top_three
|
||||
|
||||
BEISPIEL = "1\n2\n\n5\n\n3\n4\n\n10\n\n6\n"
|
||||
|
||||
|
||||
def test_parse():
|
||||
# Drei Gruppen: zwei Zahlen, eine Zahl, zwei Zahlen usw.
|
||||
assert parse("1\n2\n\n5") == [[1, 2], [5]]
|
||||
|
||||
|
||||
def test_group_sums():
|
||||
assert group_sums(BEISPIEL) == [3, 5, 7, 10, 6]
|
||||
|
||||
|
||||
def test_max_calories():
|
||||
assert max_calories(BEISPIEL) == 10
|
||||
|
||||
|
||||
def test_top_three():
|
||||
# 10 + 7 + 6
|
||||
assert top_three(BEISPIEL) == 23
|
||||
Reference in new issue
Block a user