-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update tests. permission denied claims 2==1?
- Loading branch information
Showing
3 changed files
with
13 additions
and
9 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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import unittest | ||
|
||
from amdfan.amdfan import Card | ||
|
||
from amdfan.controller import Card | ||
|
||
pwm_max = 250 | ||
pwm_min = 0 | ||
|
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 |
---|---|---|
@@ -1,26 +1,31 @@ | ||
import unittest | ||
|
||
from click.testing import CliRunner | ||
from amdfan.amdfan import cli | ||
|
||
from amdfan.commands import cli | ||
|
||
|
||
class TestCli(unittest.TestCase): | ||
def test_params(self): | ||
daemon_param = "--daemon" | ||
daemon_param = ["daemon"] | ||
runner = CliRunner() | ||
result = runner.invoke(cli, daemon_param) | ||
assert result.exception | ||
assert result.exit_code == 1 # should be permission denied for non-root | ||
help_param = "--help" | ||
|
||
help_param = ["--help"] | ||
result = runner.invoke(cli, help_param) | ||
assert result.exit_code == 0 | ||
config_param = "--configuration" | ||
|
||
config_param = ["print-default", "--configuration"] | ||
result = runner.invoke(cli, config_param) | ||
assert result.exit_code == 0 | ||
service_param = "--service" | ||
|
||
service_param = ["print-default", "--service=systemd"] | ||
result = runner.invoke(cli, service_param) | ||
assert result.exit_code == 0 | ||
manual_param = "--manual" | ||
|
||
manual_param = "set" | ||
result = runner.invoke(cli, manual_param, input="\n".join(["card0", "25"])) | ||
assert result.exception | ||
assert result.exit_code == 1 # should be permission denied for non-root |
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