Skip to content

Commit 787361d

Browse files
committed
ch09: add test_frobnicate with fmt directives
1 parent dedabe4 commit 787361d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from hashlib import md5
2+
3+
import pytest
4+
5+
6+
def frobnicate(s):
7+
return md5(s.encode()).hexdigest()
8+
9+
10+
@pytest.mark.parametrize(
11+
("value", "expected"),
12+
[
13+
("first test value", "61df19525cf97aa3855b5aeb1b2bcb89"),
14+
("another test value", "5768979c48c30998c46fb21a91a5b266"),
15+
("and here's another one", "e766977069039d83f01b4e3544a6a54c"),
16+
]
17+
) # fmt: skip
18+
def test_frobnicate(value, expected):
19+
assert expected == frobnicate(value)

0 commit comments

Comments
 (0)