File: test_plugin.py

package info (click to toggle)
asciidoc 10.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,060 kB
  • sloc: xml: 17,324; python: 8,192; javascript: 4,101; sh: 451; makefile: 110
file content (18 lines) | stat: -rw-r--r-- 544 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18


from asciidoc.message import Message
from asciidoc.plugin import Plugin

from .utils import Struct, TEST_DIR

PLUGIN_DIR = TEST_DIR / 'plugin'
CONFIG = Struct(get_load_dirs=lambda: [str(PLUGIN_DIR)], verbose=True)


def test_plugin_list(capsys) -> None:
    plugin = Plugin('backend', Message(None, None, CONFIG, None), CONFIG)
    plugin.list([])
    captured = capsys.readouterr()
    backend_dir = PLUGIN_DIR / 'backends'
    assert captured.out == "{}\n{}\n".format(backend_dir / 'bar', backend_dir / 'foo')
    assert captured.err == ''