Skip to content

Commit

Permalink
Add first tests (#37)
Browse files Browse the repository at this point in the history
* Add first tests

* Fix args type
  • Loading branch information
bhirsz authored Aug 15, 2022
1 parent 1cdf72f commit bc64340
Show file tree
Hide file tree
Showing 6 changed files with 1,249 additions and 2 deletions.
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

0 comments on commit bc64340

Please sign in to comment.