Skip to content

Commit

Permalink
Add tests for 320x240
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Oct 26, 2021
1 parent c87c725 commit 4c28f64
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library/tests/test_dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ def test_240_240(GPIO, spidev):
assert display.width == 240
assert display.height == 240


def test_240_135(GPIO, spidev):
import ST7789
display = ST7789.ST7789(port=0, cs=0, dc=24, width=240, height=135, rotation=0)
assert display.width == 240
assert display.height == 135


def test_320_240(GPIO, spidev):
import ST7789
display = ST7789.ST7789(port=0, cs=0, dc=24, width=320, height=240, rotation=0)
assert display.width == 320
assert display.height == 240
16 changes: 16 additions & 0 deletions library/tests/test_setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
import pytest

def test_setup(GPIO, spidev):
import ST7789
display = ST7789.ST7789(port=0, cs=0, dc=24)
del display


def test_unsupported_rotation_320_x_240_90(GPIO, spidev):
import ST7789
with pytest.raises(RuntimeError):
display = ST7789.ST7789(port=0, cs=0, dc=24, width=320, height=240, rotation=90)
del display


def test_unsupported_rotation_320_x_240_270(GPIO, spidev):
import ST7789
with pytest.raises(RuntimeError):
display = ST7789.ST7789(port=0, cs=0, dc=24, width=320, height=240, rotation=270)
del display

0 comments on commit 4c28f64

Please sign in to comment.