-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66fe6a8
commit e2a1669
Showing
3 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Unit tests for the Stair Flask application.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Unit tests for the LEDController class.""" | ||
|
||
from unittest.mock import MagicMock | ||
|
||
from app import Color, LEDController | ||
from app.led_controller import Direction | ||
|
||
|
||
def test_led_controller_color_wipe() -> None: | ||
# Create a mock PixelStrip object | ||
mock_pixelstrip = MagicMock() | ||
|
||
# Create an instance of LEDController with the mock PixelStrip | ||
led_controller = LEDController(10, 10, 800000, 10, 255, False, 0) | ||
led_controller.strip = mock_pixelstrip | ||
|
||
# Call the color_wipe method | ||
color = Color(0, 0, 255) # Assuming Color is a class with RGB values | ||
wait_ms = 50 | ||
direction = Direction.TOP_TO_BOTTOM | ||
led_controller.color_wipe(color, wait_ms, direction) | ||
|
||
assert True |