From c62bbe36e516ee7995df01e7d6d71078e1162205 Mon Sep 17 00:00:00 2001 From: Mazunki Hoksaas Date: Fri, 28 Jun 2024 23:07:22 +0200 Subject: [PATCH] update tests. permission denied claims 2==1? --- tests/test_card.py | 3 +-- tests/test_cli.py | 17 +++++++++++------ tests/test_curve.py | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/test_card.py b/tests/test_card.py index fb19bb9..2da9daa 100644 --- a/tests/test_card.py +++ b/tests/test_card.py @@ -1,7 +1,6 @@ import unittest -from amdfan.amdfan import Card - +from amdfan.controller import Card pwm_max = 250 pwm_min = 0 diff --git a/tests/test_cli.py b/tests/test_cli.py index 4c2ab3a..81e7637 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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 diff --git a/tests/test_curve.py b/tests/test_curve.py index 0debeb7..3090947 100644 --- a/tests/test_curve.py +++ b/tests/test_curve.py @@ -1,6 +1,6 @@ import unittest -from amdfan.amdfan import Curve +from amdfan.controller import Curve class TestCurve(unittest.TestCase):