コード例 #1
0
ファイル: playlists_test.py プロジェクト: abarisain/mopidy
    def test_playlist_contents_is_written_to_disk(self):
        track = Track(uri=generate_song(1))
        playlist = self.core.playlists.create('test')
        playlist_path = os.path.join(self.playlists_dir, 'test.m3u')
        playlist = playlist.copy(tracks=[track])
        playlist = self.core.playlists.save(playlist)

        with open(playlist_path) as playlist_file:
            contents = playlist_file.read()

        self.assertEqual(track.uri, contents.strip())
コード例 #2
0
ファイル: playlists_test.py プロジェクト: Halfnhav/mopidy
    def test_playlist_contents_is_written_to_disk(self):
        track = Track(uri=generate_song(1))
        track_path = track.uri[len('file://'):]
        playlist = self.core.playlists.create('test')
        playlist_path = playlist.uri[len('file://'):]
        playlist = playlist.copy(tracks=[track])
        playlist = self.core.playlists.save(playlist)

        with open(playlist_path) as playlist_file:
            contents = playlist_file.read()

        self.assertEqual(track_path, contents.strip())
コード例 #3
0
ファイル: stored_playlists_test.py プロジェクト: Dvad/mopidy
    def test_playlist_contents_get_written_to_disk(self):
        track = Track(uri=generate_song(1))
        uri = track.uri[len('file://'):]
        playlist = Playlist(tracks=[track], name='test')
        path = os.path.join(settings.LOCAL_PLAYLIST_PATH, 'test.m3u')

        self.stored.save(playlist)

        with open(path) as playlist_file:
            contents = playlist_file.read()

        self.assertEqual(uri, contents.strip())