Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first tests #37

Merged
merged 2 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 138 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ types-requests = "^2.27.29"
sphinx = ">=5.1"
furo = ">=2022.6.21"
sphinx_design = "^0.2.0"
pytest = "^7.1.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
Empty file added tests/__init__.py
Empty file.
21 changes: 21 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import pytest

from .utils import TEST_DATA_DIR, run_cli


class TestGenerate:
def test_generate(self):
"""Asserts that roboswag does not fail when generating from spec file."""
spec = TEST_DATA_DIR / "petstore_v2" / "petstore.json"
run_cli(f"generate -s {spec}".split())


@pytest.mark.parametrize("help_cmd", ["-h", "--help"])
@pytest.mark.parametrize("command", [None, "generate"])
def test_help(command, help_cmd):
if command:
args = [command, help_cmd]
else:
args = [help_cmd]
result = run_cli(args)
assert "Usage: " in result.output
Loading