Skip to content

Commit

Permalink
update tests. permission denied claims 2==1?
Browse files Browse the repository at this point in the history
  • Loading branch information
mazunki committed Jun 28, 2024
1 parent 019ef89 commit c62bbe3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
3 changes: 1 addition & 2 deletions tests/test_card.py
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
Expand Down
17 changes: 11 additions & 6 deletions tests/test_cli.py
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
2 changes: 1 addition & 1 deletion tests/test_curve.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest

from amdfan.amdfan import Curve
from amdfan.controller import Curve


class TestCurve(unittest.TestCase):
Expand Down

0 comments on commit c62bbe3

Please sign in to comment.