1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 from elisa.extern.translation import Translator
17
18 from elisa.core import log, common
19
20 common.from_test = True
21
22 from elisa.core import application
23 from elisa.core import config, plugin_registry
24 from elisa.core import interface_controller
25 from elisa.core import media_manager
26 from elisa.core import metadata_manager
27 from elisa.core import input_manager
28 from elisa.core import plugin
29 from elisa.core.bus import bus
30 from elisa.base_components import view, context, activity, model, controller,\
31 theme
32 from elisa.extern.log import log as extern_log
33
34 from twisted.trial import unittest
35 import os, sys, inspect
36
37
38
39 DEFAULT_CONFIG = """\
40 [general]
41 version = '%(version)s'
42 install_date = '%(install_date)s'
43 media_providers = []
44 metadata_providers = []
45 service_providers = []
46 player_engines = []
47 backends = ['backend1']
48 frontends = ['frontend1']
49
50 [media_scanner]
51 enabled = '1'
52 db_backend = 'sqlite'
53 database = 'elisa.db'
54 fivemin_location_updates = []
55 hourly_location_updates = []
56 daily_location_updates = []
57 weekly_location_updates = []
58 unmonitored_locations = []
59
60 [backend1]
61 activity = 'test:elisa_activity'
62 mvc_mappings = 'test_mvc_mappings.conf'
63 input_providers = []
64
65 [frontend1]
66 backend = 'backend1'
67 theme = 'test:test_theme'
68 input_providers = []
69
70 [xmlmenu:locations_builder]
71 locations = []
72 auto_locations = 1
73
74 [lirc:lirc_input]
75 # filename of the LIRC config map to use
76 lirc_rc = 'streamzap.lirc'
77 delay = '4'
78 repeat = '1'
79
80 [coherence:coherence_service]
81 logmode = 'none'
82 controlpoint = 'yes'
83
84 [[plugins]]
85
86 [base:service_activity]
87 # a list of activites, which should beappear in the service_menu
88 service_activities = ['service:about_activity']
89
90 [dvd:dvd_activity]
91 # uri of the dvd. must be file:///* or dvd://
92 dvd_uri = 'dvd://'
93
94 [player]
95 audiosink = 'autoaudiosink'
96
97 [theme_switcher:theme_switcher_activity]
98 # a list of themes 'plugin:component' like 'classic:theme'
99 themes = ['poblenou:tango_theme', 'poblenou:poblenou_theme', 'poblenou:chris_theme']
100 """
101
102
103 MAPPINGS="""\
104 [test:elisa_model]
105 supported_controllers = ['test:elisa_controller',]
106 controller = 'test:elisa_controller'
107 supported_views = ['test:elisa_view']
108 view = 'test:elisa_view'
109 """
110
113
115 name = 'elisa_model'
116 path = 'test:elisa_model'
117
121
123 name = 'elisa_activity'
124
127
132
133 -class TestContext(context.Context):
134 name = 'elisa_context'
135
145
147
148 - def __init__(self, config_file, default_config=None, load_all_plugins=False):
172
176
214