diff options
author | Daniel Schadt <kingdread@gmx.de> | 2021-08-26 21:02:09 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2021-08-26 21:02:09 +0200 |
commit | 0a3b5dca1fd022f0071f0fd9895e3680a23bee7a (patch) | |
tree | a474a8481b0e75f2151533b6dcd6d827c44eb16a /tests/test_doctests.txt | |
parent | 391ffada5b7f60e9519e66eef780a1e6117d5cb6 (diff) | |
download | wikimini-0a3b5dca1fd022f0071f0fd9895e3680a23bee7a.tar.gz wikimini-0a3b5dca1fd022f0071f0fd9895e3680a23bee7a.tar.bz2 wikimini-0a3b5dca1fd022f0071f0fd9895e3680a23bee7a.zip |
start working on more tests
Diffstat (limited to 'tests/test_doctests.txt')
-rw-r--r-- | tests/test_doctests.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_doctests.txt b/tests/test_doctests.txt new file mode 100644 index 0000000..692690b --- /dev/null +++ b/tests/test_doctests.txt @@ -0,0 +1,22 @@ +Document #1: + +>>> from wikimini.document import * +>>> blocks = [] +>>> insert_into(blocks, Plain("Paragraph ")) +>>> insert_into(blocks, Plain("1\n\nParagraph 2")) +>>> # blocks == [Paragraph(...), Paragraph(...)] +>>> assert len(blocks) == 2 + +Document #2: + +>>> from wikimini.document import * +>>> verbatim = Verbatim("") +>>> verbatim.append(InlineLink("http://localhost", Plain("Visit here!"))) +>>> assert verbatim.text == "Visit here!" + +Format #1: + +>>> from wikimini.document import Heading +>>> from wikimini.formats import gemtext, as_string +>>> as_string(gemtext.Gemtext(None), Heading(1, "Coffee")) +'# Coffee\n' |