Skip to content

Commit

Permalink
docs: update README examples and enhance test for README validation
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Aug 12, 2024
1 parent f52230a commit bc13e76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion tests/test_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit bc13e76

Please sign in to comment.