diff --git a/library/tests/test_dimensions.py b/library/tests/test_dimensions.py index 2521469..1139291 100644 --- a/library/tests/test_dimensions.py +++ b/library/tests/test_dimensions.py @@ -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 diff --git a/library/tests/test_setup.py b/library/tests/test_setup.py index 41a8e61..0cde59b 100644 --- a/library/tests/test_setup.py +++ b/library/tests/test_setup.py @@ -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 \ No newline at end of file