Rename basetests to base
This commit is contained in:
parent
3cb382e495
commit
07f98fbf4f
@ -1,46 +0,0 @@
|
|||||||
class BaseCurrentPlaylistControllerTest(object):
|
|
||||||
uris = []
|
|
||||||
backend_class = None
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
self.backend = self.backend_class()
|
|
||||||
|
|
||||||
def test_add(self):
|
|
||||||
playlist = self.backend.current_playlist
|
|
||||||
|
|
||||||
for uri in self.uris:
|
|
||||||
playlist.add(uri)
|
|
||||||
self.assertEqual(uri, playlist.tracks[-1].uri)
|
|
||||||
|
|
||||||
def test_add_at_position(self):
|
|
||||||
playlist = self.backend.current_playlist
|
|
||||||
|
|
||||||
for uri in self.uris:
|
|
||||||
playlist.add(uri, 0)
|
|
||||||
self.assertEqual(uri, playlist.tracks[0].uri)
|
|
||||||
|
|
||||||
# FIXME test other placements
|
|
||||||
|
|
||||||
class BasePlaybackControllerTest(object):
|
|
||||||
backend_class = None
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
self.backend = self.backend_class()
|
|
||||||
|
|
||||||
def test_play(self):
|
|
||||||
playback = self.backend.playback
|
|
||||||
|
|
||||||
self.assertEqual(playback.state, playback.STOPPED)
|
|
||||||
|
|
||||||
playback.play()
|
|
||||||
|
|
||||||
self.assertEqual(playback.state, playback.PLAYING)
|
|
||||||
|
|
||||||
def test_next(self):
|
|
||||||
playback = self.backend.playback
|
|
||||||
|
|
||||||
current_song = playback.playlist_position
|
|
||||||
|
|
||||||
playback.next()
|
|
||||||
|
|
||||||
self.assertEqual(playback.playlist_position, current_song+1)
|
|
||||||
@ -4,8 +4,8 @@ import os
|
|||||||
from mopidy.models import Playlist, Track
|
from mopidy.models import Playlist, Track
|
||||||
from mopidy.backends.gstreamer import GStreamerBackend
|
from mopidy.backends.gstreamer import GStreamerBackend
|
||||||
|
|
||||||
from tests.backends.basetests import (BasePlaybackControllerTest,
|
from tests.backends.base import (BasePlaybackControllerTest,
|
||||||
BaseCurrentPlaylistControllerTest)
|
BaseCurrentPlaylistControllerTest)
|
||||||
|
|
||||||
folder = os.path.dirname(__file__)
|
folder = os.path.dirname(__file__)
|
||||||
folder = os.path.join(folder, '..', 'data')
|
folder = os.path.join(folder, '..', 'data')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user