Skip to content

Commit

Permalink
Update lesson_1_test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ikostan authored Jun 26, 2024
1 parent 428e888 commit a66b78e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/lesson_1_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest
from unittest.mock import MagicMock
from lessons.lesson_1.main import ( # pylint: disable=import-error
led
LED
)


Expand All @@ -19,20 +19,20 @@ def test_led_on(self):
Mock the led.value() function and return 1 always
"""

led.value = MagicMock()
led.value(1)
led.value.return_value = 1
self.assertEqual(led.value(), 1)
LED.value = MagicMock()
LED.value(1)
LED.value.return_value = 1
self.assertEqual(LED.value(), 1)

def test_led_off(self):
"""
Mock the led.value() function and return 0 always
"""

led.value = MagicMock()
led.value(0)
led.value.return_value = 0
self.assertEqual(led.value(), 0)
LED.value = MagicMock()
LED.value(0)
LED.value.return_value = 0
self.assertEqual(LED.value(), 0)


if __name__ == '__main__':
Expand Down

0 comments on commit a66b78e

Please sign in to comment.