From bc13e76d546a7f74c7e838d0e2513a5c2a60e28f Mon Sep 17 00:00:00 2001 From: Titusz Pan Date: Mon, 12 Aug 2024 12:39:51 +0200 Subject: [PATCH] docs: update README examples and enhance test for README validation --- README.md | 4 +++- tests/test_readme.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa60f65..8987a57 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ Generate a Semantic Text-Code using the create function: "iscc": "ISCC:CADV3GG6JH3XEVRNSVYGCLJ7AAV3BOT5J7EHEZKPFXEGRJ2CTWACGZI", "characters": 77 } + ``` poet For granular (per chunk) feature outputs: @@ -74,13 +75,14 @@ poet For granular (per chunk) feature outputs: "characters": 77, "features": [ { - "feature": "LWMN4SPXOJLC2", + "feature": "XZjeSfdyVi0", "offset": 0, "size": 77, "text": "This is some sample text. It can be a longer document or even an entire book." } ] } + ``` The installation also provides a sct command-line tool: diff --git a/tests/test_readme.py b/tests/test_readme.py index c5dabd3..b7a5f68 100644 --- a/tests/test_readme.py +++ b/tests/test_readme.py @@ -5,4 +5,7 @@ def test_readme_examples(): - doctest.testfile(README.as_posix(), module_relative=False, optionflags=doctest.ELLIPSIS) + failure_count, test_count = doctest.testfile( + README.as_posix(), module_relative=False, optionflags=doctest.ELLIPSIS, raise_on_error=False + ) + assert failure_count == 0, f"{failure_count} out of {test_count} doctests failed"