Skip to content

Commit

Permalink
Patched /tmp/tmpks_y3orl/tests/test_footnotes.py
Browse files Browse the repository at this point in the history
  • Loading branch information
patched.codes[bot] committed Nov 1, 2024
1 parent d6c98c3 commit 015c3f5
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions tests/test_footnotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,100 @@


def test_empty():
"""Test if an empty MkFootNotes object produces an empty string representation.
Args:
None
Returns:
None: This test method doesn't return a value, it uses assertions.
Raises:
AssertionError: If the string representation of an empty MkFootNotes object is not empty.
"""
annotation = mk.MkFootNotes()
assert not str(annotation)


def test_if_annotations_get_sorted():
"""Tests if annotations in MkFootNotes are sorted correctly.
This method creates an instance of MkFootNotes, adds footnotes with
out-of-order keys, and checks if the string representation is sorted
as expected.
Args:
None
Returns:
None
Raises:
AssertionError: If the string representation of the MkFootNotes
instance does not match the expected sorted output.
"""
node = mk.MkFootNotes()
node[2] = "2"
node[1] = "1"
assert str(node) == EXPECTED_SORTED


def test_markdown():
"""Test the markdown footnotes functionality.
Args:
None
Returns:
None
Raises:
AssertionError: If the string representation of the MkFootNotes object
does not match the expected output.
"""
annotation = mk.MkFootNotes(["abcde\nfghi"] * 10, header="Header")
assert str(annotation) == EXPECTED


def test_constructors():
"""Tests the constructors of the MkFootNotes class.
This method creates two MkFootNotes objects using different constructor
approaches and asserts that their string representations are equal.
Args:
None
Returns:
None
Raises:
AssertionError: If the string representations of the two MkFootNotes
objects are not equal.
"""
annotation_1 = mk.MkFootNotes(["abc", "def"])
anns = {1: "abc", 2: "def"}
annotation_2 = mk.MkFootNotes(anns)
assert str(annotation_1) == str(annotation_2)


def test_mapping_interface():
"""Tests the mapping interface of the MkFootNotes class.
This method creates an instance of MkFootNotes, assigns a value to a key,
and asserts that the string representation of the assigned value matches
the expected format for a footnote.
Args:
None
Returns:
None
Raises:
AssertionError: If the string representation of the assigned footnote
does not match the expected format.
"""
ann = mk.MkFootNotes()
ann[1] = "test"
assert str(ann[1]) == "[^1]:\n test\n"
Expand Down

0 comments on commit 015c3f5

Please sign in to comment.