Skip to content

Commit 3c2598d

Browse files
committed
Add additional tests based on hashes
1 parent 2a38d50 commit 3c2598d

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

tests/test_generation.py

+29-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,32 @@
66
def test_import2md() -> None:
77
generator = MarkdownGenerator()
88
markdown = generator.import2md(MarkdownGenerator.import2md)
9-
md_hash = hashlib.md5(markdown.encode("utf-8")).hexdigest()
10-
assert md_hash == "4a2b89327414077031d103b4cf6672b6"
9+
# Remove whitespaces: fix changes between py version 3.6 3.7 in signature method
10+
md_hash = hashlib.md5(markdown.replace(" ", "").encode("utf-8")).hexdigest()
11+
assert md_hash == "4f5254f4be4158f984b7a9741d118698"
12+
13+
14+
def test_class2md() -> None:
15+
generator = MarkdownGenerator()
16+
markdown = generator.class2md(MarkdownGenerator)
17+
# Remove whitespaces: fix changes between py version 3.6 3.7 in signature method
18+
md_hash = hashlib.md5(markdown.replace(" ", "").encode("utf-8")).hexdigest()
19+
assert md_hash == "ea0ad63a9018a85d8d76f9a6ad7f7985"
20+
21+
22+
def test_module2md() -> None:
23+
generator = MarkdownGenerator()
24+
from lazydocs import generation
25+
26+
markdown = generator.module2md(generation)
27+
# Remove whitespaces: fix changes between py version 3.6 3.7 in signature method
28+
md_hash = hashlib.md5(markdown.replace(" ", "").encode("utf-8")).hexdigest()
29+
assert md_hash == "f6a3d5a8cd05f9f97adedbbe5d212fa2"
30+
31+
32+
def test_func2md() -> None:
33+
generator = MarkdownGenerator()
34+
markdown = generator.func2md(MarkdownGenerator.func2md)
35+
# Remove whitespaces: fix changes between py version 3.6 3.7 in signature method
36+
md_hash = hashlib.md5(markdown.replace(" ", "").encode("utf-8")).hexdigest()
37+
assert md_hash == "797bad8c00ee6f189cb6f578eaec02c4"

0 commit comments

Comments
 (0)