forked from cskau/Python_ST7735
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Showing
5 changed files
with
25 additions
and
64 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 |
---|---|---|
@@ -1,17 +1,10 @@ | ||
from tools import force_reimport | ||
|
||
|
||
def test_128_64_0(GPIO, spidev, numpy): | ||
force_reimport('ST7735') | ||
import ST7735 | ||
display = ST7735.ST7735(port=0, cs=0, dc=24, width=128, height=64, rotation=0) | ||
def test_128_64_0(GPIO, spidev, numpy, st7735): | ||
display = st7735.ST7735(port=0, cs=0, dc=24, width=128, height=64, rotation=0) | ||
assert display.width == 128 | ||
assert display.height == 64 | ||
|
||
|
||
def test_128_64_90(GPIO, spidev, numpy): | ||
force_reimport('ST7735') | ||
import ST7735 | ||
display = ST7735.ST7735(port=0, cs=0, dc=24, width=128, height=64, rotation=90) | ||
def test_128_64_90(GPIO, spidev, numpy, st7735): | ||
display = st7735.ST7735(port=0, cs=0, dc=24, width=128, height=64, rotation=90) | ||
assert display.width == 64 | ||
assert display.height == 128 |
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 |
---|---|---|
@@ -1,25 +1,18 @@ | ||
import mock | ||
from tools import force_reimport | ||
|
||
|
||
def test_display(GPIO, spidev, numpy): | ||
force_reimport('ST7735') | ||
import ST7735 | ||
display = ST7735.ST7735(port=0, cs=0, dc=24) | ||
def test_display(GPIO, spidev, numpy, st7735): | ||
display = st7735.ST7735(port=0, cs=0, dc=24) | ||
numpy.dstack().flatten().tolist.return_value = [0xff, 0x00, 0xff, 0x00] | ||
display.display(mock.MagicMock()) | ||
|
||
spidev.SpiDev().xfer3.assert_called_with([0xff, 0x00, 0xff, 0x00]) | ||
|
||
|
||
def test_color565(GPIO, spidev, numpy): | ||
force_reimport('ST7735') | ||
import ST7735 | ||
assert ST7735.color565(255, 255, 255) == 0xFFFF | ||
def test_color565(GPIO, spidev, numpy, st7735): | ||
assert st7735.color565(255, 255, 255) == 0xFFFF | ||
|
||
|
||
def test_image_to_data(GPIO, spidev, numpy): | ||
force_reimport('ST7735') | ||
def test_image_to_data(GPIO, spidev, numpy, st7735): | ||
numpy.dstack().flatten().tolist.return_value = [] | ||
import ST7735 | ||
assert ST7735.image_to_data(mock.MagicMock()) == [] | ||
assert st7735.image_to_data(mock.MagicMock()) == [] |
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 was deleted.
Oops, something went wrong.