infopanel.tests package

Submodules

infopanel.tests.dummy_screen module

Dummy screen for testing in development using pygame.

This shows a graphical window on your computer instead of using a RGB matrix.

Activate with DummyMatrix: your config file.

class infopanel.tests.dummy_screen.DummyScreen(width=64, height=32)

Bases: infopanel.display.Display

A dummy screen for testing purposes.

brightness

Brightness of display from 0 to 100.

buffer()

Swap the off-display canvas/buffer with the on-display one and scale it.

clear()

Clear the canvas.

height

Height of the display in pixels.

set_image(image, x=0, y=0)

Apply an image to the screen.

set_pixel(x, y, red, green, blue)

Set a pixel to a color.

text(font, x, y, red, green, blue, text)

Render text in a font to a place on the screen in a certain color.

width

Width of the display in pixels.

infopanel.tests.test_scenes module

Test Scenes.

class infopanel.tests.test_scenes.TestScenes(methodName='runTest')

Bases: unittest.case.TestCase

Test scenes.

setUp()

Set up each test.

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

test_all()

Test all configured sprites.

test_factory()

Test the factory.

infopanel.tests.test_scenes.build_test_scenes(sprites_here)

Build scenes for testing.

infopanel.tests.test_sprites module

Tests for sprites.

class infopanel.tests.test_sprites.TestSprite(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

test_factory()
test_value_updates()
class infopanel.tests.test_sprites.TestTemperature(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Build temperature sprites from config.

test_bounds_as_input()

Make sure configured low_val gets applied correctly.

test_scroll_frames()

Make sure frames are dealt with for non-animated things.

infopanel.tests.test_sprites.build_test_sprites()

Module contents

Universal test stuff.

class infopanel.tests.MockDisplay

Bases: infopanel.display.Display

A display mock.

height

Get the height.

width

Get the width.

infopanel.tests.load_test_config()

Load a pre-packaged test config.