~vthompson/music-app/fixes-1251630

« back to all changes in this revision

Viewing changes to tests/autopilot/music_app/tests/__init__.py

* Add autopilot test for shuffle
* Add mp3 content
* Modify exiting test case to test mp3 (always last item). Fixes: https://bugs.launchpad.net/bugs/1188349, https://bugs.launchpad.net/bugs/1222024.

Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
        #copy content
153
153
        shutil.copy(os.path.join(content_dir, '1.ogg'), musicpath)
154
154
        shutil.copy(os.path.join(content_dir, '2.ogg'), musicpath)
 
155
        shutil.copy(os.path.join(content_dir, '3.mp3'), musicpath)
155
156
        if self.test_type != 'click':
156
157
            shutil.copytree(os.path.join(content_dir, 'mediascanner'),
157
158
                            mediascannerpath)
175
176
        logger.debug("Patching fake mediascanner database")
176
177
        relhome = self.home_dir[1:]
177
178
        dblocation = "home/autopilot-music-app"
178
 
        dbfoldername = "ea50858c-4b21-4f87-9005-40aa960a84a3"
 
179
        dbfoldername = "d15682c3-89f1-4e41-abfc-531e4740e5a7"
179
180
        #patch mediaindex
180
181
        self._file_find_replace(mediascannerpath +
181
182
                                "/mediaindex", dblocation, relhome)
182
183
 
183
184
        #patch file indexes
184
185
        index_template = '%s/%s/_%%s.cfs' % (mediascannerpath, dbfoldername)
185
 
        for i in range(4):
 
186
        for i in range(5):
186
187
            self._file_find_replace(index_template % i, dblocation, relhome)
187
188
 
188
189
    def _file_find_replace(self, in_filename, find, replace):