1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 from elisa.core.tests.elisa_test_case import ElisaTestCase
18
19 from elisa.core import config, config_upgrader
20 import os
21
23
24 data_dir = '../elisa/core/tests/data'
25
26 - def _upgrade(self, old_conf_file, default_conf_file, version):
40
42 for path in ['base:local_media', 'coherence_plugin:upnp_media',
43 'media_good:gnomevfs_media', 'media_bad:ipod_media',
44 'media_good:elisa_media', 'audiocd:audiocd_media']:
45 self.failIf(path not in cfg.get_option('media_providers'))
46
47 for path in ['media_good:amazon_covers', 'media_good:taglib_metadata',
48 'media_good:cover_cache', 'media_good:gst_metadata',
49 'media_good:cover_in_dir']:
50 self.failIf(path not in cfg.get_option('metadata_providers'))
51
52 for path in ['base:audio_activity', 'base:video_activity',
53 'base:image_activity', 'base:config_activity',
54 'base:service_activity']:
55 self.failIf(path not in cfg.get_option('menu_activities',
56 section='base:main_menu_activity'))
57
58 self.assertEqual(cfg.get_option('input_providers', section='backend1'),
59 ['input_good:lirc_input'])
60 self.assertEqual(cfg.get_option('input_providers', section='frontend1'),
61 ['pigment:pigment_input'])
62 self.assertEqual(cfg.get_option('service_providers'),
63 ['hal:hal_service',
64 'coherence_plugin:coherence_service'])
65 self.assertEqual(cfg.get_option('service_activities',
66 section='base:service_activity'),
67 ['service:about_activity'])
68
70 media_providers = ['daap:daap_media', 'youtube:youtube_media',
71 'shoutcast:shoutcast_media', 'fspot:fspot_media',
72 'coherence:upnp_media', 'ipod:ipod_media',
73 'base:local_media', 'media_db:elisa_media',
74 'gvfs:gnomevfs_media', 'audiocd:audiocd_media',
75 'flickr:flickr_media', 'stage6:stage_media']
76 cfg_media_providers = cfg.get_option('media_providers', default=[])
77 for path in media_providers:
78 self.failIf(path not in cfg_media_providers,
79 '%r not in media_providers %r' % (path,
80 cfg_media_providers))
81
82 metadata_providers = ['gstreamer:gst_metadata_client',
83 'album_art:cover_in_dir', 'amazon:amazon_covers']
84 for path in metadata_providers:
85 self.failIf(path not in cfg.get_option('metadata_providers',
86 default=[]))
87
88 service_providers = ['gnome:gnome_screensaver_service',
89 'hal:hal_service',
90 'coherence:coherence_service']
91 cfg_service_providers = cfg.get_option('service_providers',
92 default=[])
93 for path in service_providers:
94 self.failIf(path not in cfg_service_providers,
95 "%r not in service_providers %r" % (path,
96 cfg_service_providers))
97
98 self.assertEqual(cfg.get_option('service_activities',
99 section='base:service_activity'),
100 ['service:about_activity'])
101
102 themes = ['raval:tango_theme', 'raval:poblenou_theme',
103 'raval:chris_theme']
104 cfg_themes = cfg.get_option('themes',
105 section='theme_switcher:theme_switcher_activity',
106 default=[])
107 for path in themes:
108 self.failIf(path not in cfg_themes,
109 "%r not in themes %r" % (path, cfg_themes))
110
111
112 self.assertEqual(cfg.get_option('activity', section='backend1'),
113 'raval:elisa_activity')
114 self.assertEqual(cfg.get_option('mvc_mappings', section='backend1'),
115 'raval:data/raval_mvc_mappings.conf')
116 self.assertEqual(cfg.get_option('input_providers', section='backend1'),
117 ['lirc:lirc_input'])
118
119
120 self.assertEqual(cfg.get_option('theme', section='frontend1'),
121 'raval:tango_theme')
122 self.assertEqual(cfg.get_option('input_providers', section='frontend1'),
123 ['pigment:pigment_input'])
124
125
126 removed_sections = ['base:main_menu_activity',
127 'base:player_controller',
128 'poblenou:elisa_controller',
129 'base:audio_activity', 'base:video_activity',
130 'base:image_activity', 'elisa_view']
131 for section_name in removed_sections:
132 self.failIf(cfg.get_section(section_name))
133
134
136 " 0.1.7 -> 0.3.1 "
137 self._upgrade('elisa_0_1_7.conf', 'elisa_0_3_1.conf', (0, 3, 1))
138
140 " 0.1.7 -> 0.3.2 "
141 self._upgrade('elisa_0_1_7.conf','elisa_0_3_2.conf', (0, 3, 2))
142
144 " 0.1.7 -> 0.3.3 "
145 self._upgrade('elisa_0_1_7.conf','elisa_0_3_3.conf', (0, 3, 3))
146
148 " 0.3.1 -> 0.3.2 "
149 cfg = self._upgrade('elisa_0_3_1.conf', 'elisa_0_3_2.conf', (0, 3, 2))
150 self._assert_0_3_2(cfg)
151
153 " 0.3.2 -> 0.3.3 "
154 cfg = self._upgrade('elisa_0_3_2.conf', 'elisa_0_3_3.conf', (0, 3, 3))
155 self._assert_0_3_3(cfg)
156