From 0a3b5dca1fd022f0071f0fd9895e3680a23bee7a Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 26 Aug 2021 21:02:09 +0200 Subject: start working on more tests --- tests/test_doctests.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/test_doctests.txt (limited to 'tests/test_doctests.txt') 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' -- cgit v1.2.3