Test full currentsong output
This commit is contained in:
parent
46af63ab7e
commit
13819b62b3
@ -150,15 +150,16 @@ class Track(object):
|
||||
:rtype: list of two-tuples
|
||||
"""
|
||||
return [
|
||||
('file', self.uri),
|
||||
('Time', self.length // 1000),
|
||||
('file', self.uri or ''),
|
||||
('Time', self.length and (self.length // 1000) or 0),
|
||||
('Artist', self.mpd_format_artists()),
|
||||
('Title', self.title),
|
||||
('Album', self.album.name),
|
||||
('Track', '%d/%d' % (self.track_no, self.album.num_tracks)),
|
||||
('Date', self.date),
|
||||
('Title', self.title or ''),
|
||||
('Album', self.album and self.album.name or ''),
|
||||
('Track', '%d/%d' % (self.track_no,
|
||||
self.album and self.album.num_tracks or 0)),
|
||||
('Date', self.date or ''),
|
||||
('Pos', position),
|
||||
('Id', self.id),
|
||||
('Id', self.id or position),
|
||||
]
|
||||
|
||||
def mpd_format_artists(self):
|
||||
|
||||
@ -94,6 +94,20 @@ class StatusHandlerTest(unittest.TestCase):
|
||||
self.assert_(u'ACK Not implemented' in result)
|
||||
|
||||
def test_currentsong(self):
|
||||
self.b.playback.current_track = Track()
|
||||
result = self.h.handle_request(u'currentsong')
|
||||
self.assert_(u'file: ' in result)
|
||||
self.assert_(u'Time: 0' in result)
|
||||
self.assert_(u'Artist: ' in result)
|
||||
self.assert_(u'Title: ' in result)
|
||||
self.assert_(u'Album: ' in result)
|
||||
self.assert_(u'Track: 0/0' in result)
|
||||
self.assert_(u'Date: ' in result)
|
||||
self.assert_(u'Pos: 0' in result)
|
||||
self.assert_(u'Id: 0' in result)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
def test_currentsong_without_song(self):
|
||||
result = self.h.handle_request(u'currentsong')
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user