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

Fix jsonpatch import warning #32

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion nettowel/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.6.0" # From Makefile
__version__ = "0.6.1" # From Makefile
6 changes: 4 additions & 2 deletions nettowel/cli/jsonpatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
)
from nettowel.exceptions import NettowelInputError

from nettowel import jsonpatch


app = get_typer_app(help="JSON Patch [RFC 6902](http://tools.ietf.org/html/rfc6902)")

Expand Down Expand Up @@ -52,6 +50,8 @@ def create(
False, "--print-result-only", help="Only print the result"
),
) -> None:
from nettowel import jsonpatch

try:
src = read_yaml(src_file_name)
dst = read_yaml(dst_file_name)
Expand Down Expand Up @@ -119,6 +119,8 @@ def apply(
False, "--print-result-only", help="Only print the result"
),
) -> None:
from nettowel import jsonpatch

try:
patch_data = read_yaml(patch_file_name)
data_input = read_yaml(data_file_name)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nettowel"
version = "0.6.0"
version = "0.6.1"
description = "Network Automation Collection"
authors = ["ubaumann <github@m.ubaumann.ch>"]
license = "Apache 2.0"
Expand Down
13 changes: 13 additions & 0 deletions tests/test_main_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import pytest
from typer.testing import CliRunner
from nettowel.cli.main import app

runner = CliRunner(mix_stderr=False)


def test_help() -> None:
result = runner.invoke(app, ["--help"])
assert result.exit_code == 0
assert "Awesome collection of network automation functions" in result.stdout
assert "Failed to import" not in result.stderr
assert not result.stderr
2 changes: 1 addition & 1 deletion tests/test_nettowel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version() -> None:
assert __version__ == "0.6.0" # From Makefile
assert __version__ == "0.6.1" # From Makefile
Loading