Source code for tests.processor.test_search
import pytest
from errors import DppNoSuchTagError
from processor.search import SearchCommand, search_by_tags
from taxonomy import Taxonomy
[docs]def test_search_command_should_raise_no_such_tag_error():
with pytest.raises(DppNoSuchTagError):
SearchCommand()(["no-such-tag"])
[docs]def test_search_command_withouth_any_args(capsys):
with pytest.raises(SystemExit):
SearchCommand()([])
captured = capsys.readouterr()
assert "usage: \nbugcpp.py search TAGS" in captured.err