Skip to content

Commit

Permalink
added test for pixel.stop_blink().
Browse files Browse the repository at this point in the history
  • Loading branch information
speratus committed Oct 2, 2019
1 parent a3e4b78 commit e4aee92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Build Status](https://travis-ci.org/speratus/Blinkter.svg?branch=master)](https://travis-ci.org/speratus/Blinkter)

[![Gitter](https://badges.gitter.im/raspberrypi-blinkter/community.svg)](https://gitter.im/raspberrypi-blinkter/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Discord](https://img.shields.io/discord/610943654806159453)](https://discord.gg/YqRfXwJ)
[![Discord](https://img.shields.io/discord/610943654806159453?label=discord&logo=discord)](https://discord.gg/YqRfXwJ)

Blinkter makes using the [Pimoroni Blinkt!](https://shop.pimoroni.com/products/blinkt) even easier by making the library object oriented and
adding several convenience methods. The intuitive objects that Blinkter layers on top of the [Blinkt!](https://github.com/pimoroni/blinkt)
Expand Down
7 changes: 7 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,13 @@ def test_advanced_blink(self, mock_set, mock_start, mock_revert, mock_black):
self.assertEqual(2, mock_black.call_count, msg=f'pixel.black() was not called the correct number of times.')
self.assertEqual(len(self.cases), mock_start.call_count, msg=f'AdvancedBlinkThread.start() was not called {len(self.cases)} times.')

@mock.patch.object(Pixel, 'black', autospec=True)
@mock.patch.object(AdvancedBlinkThread, 'stop', autospec=True)
def test_stop_blink(self, mock_stop, mock_black):
self.pixel.stop_blink()
mock_stop.assert_called()
mock_black.assert_called()


if __name__ == '__main__':
unittest.main()

0 comments on commit e4aee92

Please sign in to comment.