forked from py-vobject/vobject
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- made f-string conversions - minor linting fixes - Added tests
- Loading branch information
Showing
3 changed files
with
96 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import subprocess | ||
|
||
|
||
class Cli: | ||
ics_diff = "ics_diff" | ||
change_tz = "change_tz" | ||
|
||
|
||
def run_cli_tool(toolname: str, args: list[str]): | ||
return subprocess.run([toolname] + args, capture_output=True, text=True, check=False) | ||
|
||
|
||
def test_change_tz(): | ||
result = run_cli_tool(Cli.change_tz, ["--version"]) | ||
assert result.returncode == 0 | ||
|
||
result = run_cli_tool(Cli.change_tz, []) | ||
assert result.returncode == 2 | ||
assert "one of the arguments -l/--list ics_file is required" in result.stderr | ||
|
||
|
||
def test_ics_diff(): | ||
result = run_cli_tool(Cli.ics_diff, ["--version"]) | ||
assert result.returncode == 0 | ||
|
||
result = run_cli_tool(Cli.ics_diff, []) | ||
assert result.returncode == 2 | ||
assert "required: ics_file1, ics_file2" in result.stderr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters