From 752c3769874596d012cd8325099d2ae20123f989 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 9 Feb 2025 09:07:14 -0700 Subject: test/py: Shorten u_boot_console This fixture name is quite long and results in lots of verbose code. We know this is U-Boot so the 'u_boot_' part is not necessary. But it is also a bit of a misnomer, since it provides access to all the information available to tests. It is not just the console. It would be too confusing to use con as it would be confused with config and it is probably too short. So shorten it to 'ubman'. Signed-off-by: Simon Glass Link: https://lore.kernel.org/u-boot/CAFLszTgPa4aT_J9h9pqeTtLCVn4x2JvLWRcWRD8NaN3uoSAtyA@mail.gmail.com/ --- test/py/tests/test_pinmux.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'test/py/tests/test_pinmux.py') diff --git a/test/py/tests/test_pinmux.py b/test/py/tests/test_pinmux.py index 794994e12d1..f8c3f0dfbef 100644 --- a/test/py/tests/test_pinmux.py +++ b/test/py/tests/test_pinmux.py @@ -4,24 +4,24 @@ import pytest import u_boot_utils @pytest.mark.buildconfigspec('cmd_pinmux') -def test_pinmux_usage_1(u_boot_console): +def test_pinmux_usage_1(ubman): """Test that 'pinmux' command without parameters displays pinmux usage.""" - output = u_boot_console.run_command('pinmux') + output = ubman.run_command('pinmux') assert 'Usage:' in output @pytest.mark.buildconfigspec('cmd_pinmux') -def test_pinmux_usage_2(u_boot_console): +def test_pinmux_usage_2(ubman): """Test that 'pinmux status' executed without previous "pinmux dev" command displays error message.""" - output = u_boot_console.run_command('pinmux status') + output = ubman.run_command('pinmux status') assert 'pin-controller device not selected' in output @pytest.mark.buildconfigspec('cmd_pinmux') @pytest.mark.boardspec('sandbox') -def test_pinmux_status_all(u_boot_console): +def test_pinmux_status_all(ubman): """Test that 'pinmux status -a' displays pin's muxing.""" - output = u_boot_console.run_command('pinmux status -a') + output = ubman.run_command('pinmux status -a') assert ('pinctrl-gpio:' in output) assert ('a5 : gpio output .' in output) @@ -40,36 +40,36 @@ def test_pinmux_status_all(u_boot_console): @pytest.mark.buildconfigspec('cmd_pinmux') @pytest.mark.boardspec('sandbox') -def test_pinmux_list(u_boot_console): +def test_pinmux_list(ubman): """Test that 'pinmux list' returns the pin-controller list.""" - output = u_boot_console.run_command('pinmux list') + output = ubman.run_command('pinmux list') assert 'sandbox_pinctrl' in output @pytest.mark.buildconfigspec('cmd_pinmux') -def test_pinmux_dev_bad(u_boot_console): +def test_pinmux_dev_bad(ubman): """Test that 'pinmux dev' returns an error when trying to select a wrong pin controller.""" pincontroller = 'bad_pin_controller_name' - output = u_boot_console.run_command('pinmux dev ' + pincontroller) + output = ubman.run_command('pinmux dev ' + pincontroller) expected_output = 'Can\'t get the pin-controller: ' + pincontroller + '!' assert (expected_output in output) @pytest.mark.buildconfigspec('cmd_pinmux') @pytest.mark.boardspec('sandbox') -def test_pinmux_dev(u_boot_console): +def test_pinmux_dev(ubman): """Test that 'pinmux dev' select the wanted pin controller.""" pincontroller = 'pinctrl' - output = u_boot_console.run_command('pinmux dev ' + pincontroller) + output = ubman.run_command('pinmux dev ' + pincontroller) expected_output = 'dev: ' + pincontroller assert (expected_output in output) @pytest.mark.buildconfigspec('cmd_pinmux') @pytest.mark.boardspec('sandbox') -def test_pinmux_status(u_boot_console): +def test_pinmux_status(ubman): """Test that 'pinmux status' displays selected pincontroller's pin muxing descriptions.""" - u_boot_console.run_command('pinmux dev pinctrl') - output = u_boot_console.run_command('pinmux status') + ubman.run_command('pinmux dev pinctrl') + output = ubman.run_command('pinmux status') assert (not 'pinctrl-gpio:' in output) assert (not 'pinctrl:' in output) -- cgit v1.2.3 From d9ed4b75add4b4ccc37cf32b54cd9c77f48e3396 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 9 Feb 2025 09:07:15 -0700 Subject: test/py: Drop u_boot_ prefix on test files We know this is U-Boot so the prefix serves no purpose other than to make things longer and harder to read. Drop it and rename the files. Signed-off-by: Simon Glass Reviewed-by: Mattijs Korpershoek # test_android / test_dfu --- test/py/tests/test_pinmux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/py/tests/test_pinmux.py') diff --git a/test/py/tests/test_pinmux.py b/test/py/tests/test_pinmux.py index f8c3f0dfbef..ee79e843341 100644 --- a/test/py/tests/test_pinmux.py +++ b/test/py/tests/test_pinmux.py @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 import pytest -import u_boot_utils +import utils @pytest.mark.buildconfigspec('cmd_pinmux') def test_pinmux_usage_1(ubman): -- cgit v1.2.3