def driver_factory(disp, data_src, conf): """Build factory and add scenes and sprites.""" driver = Driver(disp, data_src) driver.sprites = sprites.sprite_factory(conf["sprites"], data_src, disp) driver.scenes = scenes.scene_factory(disp.width, disp.height, conf["scenes"], driver.sprites) driver.init_modes(conf) return driver
def build_test_sprites(): DURATION_CONFIG = { 'I90': { 'type': 'Duration', 'label': 'I90', 'low_val': 13.0, # pylint:disable=invalid-name 'high_val': 25.0, 'data_label': 'travel_time_i90' } } datasrc = data.InputData() datasrc['travel_time_i90'] = 10.0 return sprites.sprite_factory(DURATION_CONFIG, datasrc, MockDisplay())
def build_test_sprites(): # pylint:disable=invalid-name DURATION_CONFIG = { "I90": { "type": "Duration", "label": "I90", "low_val": 13.0, "high_val": 25.0, "data_label": "travel_time_i90", } } datasrc = data.InputData() datasrc["travel_time_i90"] = 10.0 return sprites.sprite_factory(DURATION_CONFIG, datasrc, MockDisplay())
def test_all(self): """Test all configured sprites.""" existing_sprites = sprites.sprite_factory(self.conf['sprites'], None, MockDisplay()) scenes.scene_factory(64, 32, self.conf['scenes'], existing_sprites)
def setUp(self): """Build temperature sprites from config.""" self.conf = load_test_config() self.sprites = sprites.sprite_factory(self.conf["sprites"], None, MockDisplay())