X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/blobdiff_plain/ce93b8c59e47b27e025d99f44b7a99c1f3d60b38..07b96113f5c7f511bcdbc32e16d0777ae4f22529:/tests/test_generic_agnostic_board_analogio.py diff --git a/tests/test_generic_agnostic_board_analogio.py b/tests/test_generic_agnostic_board_analogio.py index c1ff84e..aa36907 100644 --- a/tests/test_generic_agnostic_board_analogio.py +++ b/tests/test_generic_agnostic_board_analogio.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2024 Brent Rubell for Adafruit Industries # # SPDX-License-Identifier: MIT -import pytest +import pytest # pylint: disable=unused-import import board import analogio @@ -9,7 +9,7 @@ import analogio # Analog Outputs def test_Ax_OUTPUT(): """Test analog output pin functionality.""" - assert board.board_id == "GENERIC_AGNOSTIC_BOARD" + assert board.board_id == "OS_AGNOSTIC_BOARD" pin_out = analogio.AnalogOut(board.Ax_OUTPUT) # Test boundaries of setting the value and reading it back @@ -76,7 +76,7 @@ sawtooth_wave = [ def test_Ax_INPUT_RAND_INT(): """Test random integer from pin Ax_INPUT_RAND_INT""" - assert board.board_id == "GENERIC_AGNOSTIC_BOARD" + assert board.board_id == "OS_AGNOSTIC_BOARD" pin_random = analogio.AnalogIn(board.Ax_INPUT_RAND_INT) assert isinstance(pin_random.value, int) @@ -86,7 +86,7 @@ def test_Ax_INPUT_RAND_INT(): def test_Ax_INPUT_FIXED_INT_PI(): """Test fixed integer from pin Ax_INPUT_FIXED_INT_PI""" - assert board.board_id == "GENERIC_AGNOSTIC_BOARD" + assert board.board_id == "OS_AGNOSTIC_BOARD" pin_pi = analogio.AnalogIn(board.Ax_INPUT_FIXED_INT_PI) assert pin_pi.value == 31415 @@ -96,15 +96,15 @@ def test_Ax_INPUT_FIXED_INT_PI(): def test_Ax_INPUT_WAVE_SINE(): """Test sine wave from pin Ax_INPUT_WAVE_SINE""" - assert board.board_id == "GENERIC_AGNOSTIC_BOARD" + assert board.board_id == "OS_AGNOSTIC_BOARD" pin_sine_wave = analogio.AnalogIn(board.Ax_INPUT_WAVE_SINE) # Run through the sine wave once - for i, expected_value in enumerate(sine_wave): + for expected_value in sine_wave: assert pin_sine_wave.value == expected_value # Run through the sine wave again to ensure it loops back correctly - for i, expected_value in enumerate(sine_wave): + for expected_value in sine_wave: assert pin_sine_wave.value == expected_value pin_sine_wave.deinit() @@ -112,15 +112,15 @@ def test_Ax_INPUT_WAVE_SINE(): def test_Ax_INPUT_WAVE_SAW(): """Test sawtooth wave from pin Ax_INPUT_WAVE_SAW""" - assert board.board_id == "GENERIC_AGNOSTIC_BOARD" + assert board.board_id == "OS_AGNOSTIC_BOARD" pin_saw_wave = analogio.AnalogIn(board.Ax_INPUT_WAVE_SAW) # Run through the sine wave once - for i in range(len(sawtooth_wave)): - assert pin_saw_wave.value == sawtooth_wave[i] + for expected_value in sawtooth_wave: + assert pin_saw_wave.value == expected_value # Run through the sine wave again to ensure it loops back correctly - for i in range(len(sawtooth_wave)): - assert pin_saw_wave.value == sawtooth_wave[i] + for expected_value in sawtooth_wave: + assert pin_saw_wave.value == expected_value pin_saw_wave.deinit()