From 943e3dc057eca53e68ddec51529bd6a1279ebd8e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Apr 2024 06:23:02 +0200 Subject: Adding upstream version 0.18.1. Signed-off-by: Daniel Baumann --- tests/test_cli.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/test_cli.py (limited to 'tests/test_cli.py') diff --git a/tests/test_cli.py b/tests/test_cli.py new file mode 100644 index 0000000..4725f93 --- /dev/null +++ b/tests/test_cli.py @@ -0,0 +1,15 @@ +from unittest import mock + +from myst_parser.cli import print_anchors + + +def test_print_anchors(): + from io import StringIO + + in_stream = StringIO("# a\n\n## b\n\ntext") + out_stream = StringIO() + with mock.patch("sys.stdin", in_stream): + with mock.patch("sys.stdout", out_stream): + print_anchors(["-l", "1"]) + out_stream.seek(0) + assert out_stream.read().strip() == '

' -- cgit v1.2.3