Skip to content

Commit

Permalink
Add additional tests based on hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmasuch committed Nov 25, 2020
1 parent 2a38d50 commit 3c2598d
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions tests/test_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,32 @@
def test_import2md() -> None:
generator = MarkdownGenerator()
markdown = generator.import2md(MarkdownGenerator.import2md)
md_hash = hashlib.md5(markdown.encode("utf-8")).hexdigest()
assert md_hash == "4a2b89327414077031d103b4cf6672b6"
# Remove whitespaces: fix changes between py version 3.6 3.7 in signature method
md_hash = hashlib.md5(markdown.replace(" ", "").encode("utf-8")).hexdigest()
assert md_hash == "4f5254f4be4158f984b7a9741d118698"


def test_class2md() -> None:
generator = MarkdownGenerator()
markdown = generator.class2md(MarkdownGenerator)
# Remove whitespaces: fix changes between py version 3.6 3.7 in signature method
md_hash = hashlib.md5(markdown.replace(" ", "").encode("utf-8")).hexdigest()
assert md_hash == "ea0ad63a9018a85d8d76f9a6ad7f7985"


def test_module2md() -> None:
generator = MarkdownGenerator()
from lazydocs import generation

markdown = generator.module2md(generation)
# Remove whitespaces: fix changes between py version 3.6 3.7 in signature method
md_hash = hashlib.md5(markdown.replace(" ", "").encode("utf-8")).hexdigest()
assert md_hash == "f6a3d5a8cd05f9f97adedbbe5d212fa2"


def test_func2md() -> None:
generator = MarkdownGenerator()
markdown = generator.func2md(MarkdownGenerator.func2md)
# Remove whitespaces: fix changes between py version 3.6 3.7 in signature method
md_hash = hashlib.md5(markdown.replace(" ", "").encode("utf-8")).hexdigest()
assert md_hash == "797bad8c00ee6f189cb6f578eaec02c4"

0 comments on commit 3c2598d

Please sign in to comment.