Skip to content

Commit

Permalink
Merge pull request #43 from alunduil/release
Browse files Browse the repository at this point in the history
Release 1.1.4 (master)
  • Loading branch information
alunduil authored Apr 22, 2019
2 parents 9f3ac5d + 317a89e commit b81f1de
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
black==19.3b0
click==7.0
coveralls==1.7.0
hypothesis==3.69.2
isort==4.3.16
mypy==0.670
hypothesis==4.14.6
isort==4.3.17
mypy==0.700
pylint==2.3.1
pytest==4.3.0
pytest==4.4.1
pytest-cov==2.6.1
pytest-runner==4.4
stringcase==1.2.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="zfs-replicate",
version="1.1.3",
version="1.1.4",
description="ZFS Snapshot Replicator",
long_description=README,
url="https://github.com/alunduil/zfs-replicate",
Expand Down
20 changes: 18 additions & 2 deletions zfs_test/replicate_test/cli_test/main_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from click.testing import CliRunner
from click.testing import CliRunner, Result

from zfs.replicate.cli.main import main

Expand All @@ -8,4 +8,20 @@ def test_invokes_without_stacktrace() -> None:

runner = CliRunner()
result = runner.invoke(main, ["-l", "alunduil", "-i", "mypy.ini", "example.com", "bogus", "bogus"])
assert isinstance(result.exception, SystemExit), "Expected normal exit."
assert isinstance(result.exception, SystemExit) or file_not_found_error(
result
), "Expected SystemExit or FileNotFoundError."


def test_invokes_without_stacktrace_verbose() -> None:
"""zfs-replicate --verbose -l alunduil -i mypy.ini example.com bogus bogus => No stacktrace"""

runner = CliRunner()
result = runner.invoke(main, ["--verbose", "-l", "alunduil", "-i", "mypy.ini", "example.com", "bogus", "bogus"])
assert isinstance(result.exception, SystemExit) or file_not_found_error(
result
), "Expected SystemExit or FileNotFoundError."


def file_not_found_error(result: Result) -> bool:
return bool(FileNotFoundError(2, "No such file or directory: '/usr/bin/env'") == result.exception)
8 changes: 8 additions & 0 deletions zfs_test/replicate_test/task_test/generate_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from zfs.replicate.filesystem.type import filesystem
from zfs.replicate.task.generate import * # pylint: disable=unused-wildcard-import,wildcard-import


def test_no_tasks() -> None:
"""generate(Any, {}, {}) == []"""

assert [] == generate(filesystem("pool/filesystem"), {}, {})

0 comments on commit b81f1de

Please sign in to comment.