1- from gpio_expander import _get_registry_params
2- import pytest
3-
4-
5- def test_value_16 ():
6- _ , _w , _ , _ = _get_registry_params (16 , 1 )
7- assert _w == 2
1+ """Common method pytest module file."""
82
3+ # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
4+ # SPDX-FileCopyrightText: Copyright (c) 2022 Gabriele Pongelli
5+ #
6+ # SPDX-License-Identifier: MIT
97
10- def test_value_8 ():
11- _ , _w , _ , _ = _get_registry_params (8 , 1 )
12- assert _w == 1
8+ import pytest
9+ from gpio_expander import _get_registry_params
1310
1411
1512@pytest .mark .parametrize (
@@ -23,18 +20,18 @@ def test_value_8():
2320 pytest .param (5 , "0_" , 2 , 0 , 5 , id = "input 5" ),
2421 pytest .param (6 , "0_" , 2 , 0 , 6 , id = "input 6" ),
2522 pytest .param (7 , "0_" , 2 , 0 , 7 , id = "input 7" ),
26-
2723 pytest .param (8 , "1_" , 2 , 1 , 0 , id = "input 8" ),
2824 pytest .param (9 , "1_" , 2 , 1 , 1 , id = "input 9" ),
2925 pytest .param (10 , "1_" , 2 , 1 , 2 , id = "input 10" ),
3026 pytest .param (11 , "1_" , 2 , 1 , 3 , id = "input 11" ),
3127 pytest .param (12 , "1_" , 2 , 1 , 4 , id = "input 12" ),
3228 pytest .param (13 , "1_" , 2 , 1 , 5 , id = "input 13" ),
3329 pytest .param (14 , "1_" , 2 , 1 , 6 , id = "input 14" ),
34- pytest .param (15 , "1_" , 2 , 1 , 7 , id = "input 15" )
35- ]
30+ pytest .param (15 , "1_" , 2 , 1 , 7 , id = "input 15" ),
31+ ],
3632)
3733def test_loop_16 (x_input , exp_name , exp_addr_mul , exp_adder , exp_idx ):
34+ """Test common method for 16 GPIO expander."""
3835 _name , _reg_address_multiplier , _adder , _idx = _get_registry_params (16 , x_input )
3936 print (_name )
4037 print (_reg_address_multiplier )
@@ -57,9 +54,10 @@ def test_loop_16(x_input, exp_name, exp_addr_mul, exp_adder, exp_idx):
5754 pytest .param (5 , "" , 1 , 0 , 5 , id = "input 5" ),
5855 pytest .param (6 , "" , 1 , 0 , 6 , id = "input 6" ),
5956 pytest .param (7 , "" , 1 , 0 , 7 , id = "input 7" ),
60- ]
57+ ],
6158)
6259def test_loop_8 (x_input , exp_name , exp_addr_mul , exp_adder , exp_idx ):
60+ """Test common method for 8 GPIO expander."""
6361 _name , _reg_address_multiplier , _adder , _idx = _get_registry_params (8 , x_input )
6462 print (_name )
6563 print (_reg_address_multiplier )
0 commit comments