Skip to content

Commit

Permalink
tests: run comments and search-images
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Jan 9, 2024
1 parent dd9d89e commit 32763b4
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,26 @@ def test_cli_run_comments_latest(capsys):
assert Path(Path().home() / ".geotribu/comments/latest.json").exists()


def test_cli_run_comments_open(capsys):
"""Test nested subcommand comments latest."""
cli.main(["comments", "open"])

out, err = capsys.readouterr()

assert err == ""
assert Path(Path().home() / ".geotribu/comments/latest.json").exists()


def test_cli_run_comments_open_specific(capsys):
"""Test nested subcommand comments latest."""
cli.main(["comments", "open", "--page-size", "25", "--comment-id", "15"])

out, err = capsys.readouterr()

assert err == ""
assert Path(Path().home() / ".geotribu/comments/latest.json").exists()


def test_cli_run_contenus_articles_ubuntu(capsys):
"""Test CLI images."""
cli.main(
Expand Down Expand Up @@ -102,6 +122,18 @@ def test_cli_run_images_logo_news(capsys):
assert Path(Path().home() / ".geotribu/search/cdn_search_index.json").exists()


def test_cli_run_si_post_table(capsys):
"""Test CLI images."""
cli.main(["si", "--no-prompt", "post*"])

out, err = capsys.readouterr()

assert out.strip().startswith("Recherche dans les images")
assert err == ""

assert Path(Path().home() / ".geotribu/search/cdn_search_index.json").exists()


def test_cli_run_new_article(capsys):
"""Test subcommand creating new article."""

Expand Down

0 comments on commit 32763b4

Please sign in to comment.