tests: Use empty tag cache in all local backend tests

This commit is contained in:
Stein Magnus Jodal 2012-12-12 13:43:41 +01:00
parent 3d86610dfe
commit f302949ea9
5 changed files with 22 additions and 3 deletions

View File

@ -1,8 +1,17 @@
from mopidy import settings
from mopidy.backends.local import LocalBackend
from tests import unittest
from tests import unittest, path_to_data_dir
from tests.backends.base import events
class LocalBackendEventsTest(events.BackendEventsTest, unittest.TestCase):
backend_class = LocalBackend
def setUp(self):
settings.LOCAL_TAG_CACHE_FILE = path_to_data_dir('empty_tag_cache')
super(LocalBackendEventsTest, self).setUp()
def tearDown(self):
super(LocalBackendEventsTest, self).tearDown()
settings.runtime.clear()

View File

@ -18,6 +18,7 @@ class LocalPlaybackControllerTest(PlaybackControllerTest, unittest.TestCase):
def setUp(self):
settings.BACKENDS = ('mopidy.backends.local.LocalBackend',)
settings.LOCAL_TAG_CACHE_FILE = path_to_data_dir('empty_tag_cache')
super(LocalPlaybackControllerTest, self).setUp()
def tearDown(self):

View File

@ -18,6 +18,14 @@ class LocalPlaylistsControllerTest(
backend_class = LocalBackend
def setUp(self):
settings.LOCAL_TAG_CACHE_FILE = path_to_data_dir('empty_tag_cache')
super(LocalPlaylistsControllerTest, self).setUp()
def tearDown(self):
super(LocalPlaylistsControllerTest, self).tearDown()
settings.runtime.clear()
def test_created_playlist_is_persisted(self):
path = os.path.join(settings.LOCAL_PLAYLIST_PATH, 'test.m3u')
self.assertFalse(os.path.exists(path))

View File

@ -4,7 +4,7 @@ from mopidy import settings
from mopidy.backends.local import LocalBackend
from mopidy.models import Track
from tests import unittest
from tests import unittest, path_to_data_dir
from tests.backends.base.tracklist import TracklistControllerTest
from tests.backends.local import generate_song
@ -16,6 +16,7 @@ class LocalTracklistControllerTest(TracklistControllerTest, unittest.TestCase):
def setUp(self):
settings.BACKENDS = ('mopidy.backends.local.LocalBackend',)
settings.LOCAL_TAG_CACHE_FILE = path_to_data_dir('empty_tag_cache')
super(LocalTracklistControllerTest, self).setUp()
def tearDown(self):

View File

@ -5,9 +5,9 @@ from __future__ import unicode_literals
import os
import tempfile
from mopidy.utils.path import path_to_uri
from mopidy.backends.local.translator import parse_m3u, parse_mpd_tag_cache
from mopidy.models import Track, Artist, Album
from mopidy.utils.path import path_to_uri
from tests import unittest, path_to_data_dir