本文整理汇总了Python中mopidy.mpd.protocol.status.status函数的典型用法代码示例。如果您正苦于以下问题:Python status函数的具体用法?Python status怎么用?Python status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了status函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_status_method_when_starting_playing_contains_elapsed_zero
def test_status_method_when_starting_playing_contains_elapsed_zero(self):
self.set_tracklist([Track(uri='dummy:/a', length=10000)])
self.core.playback.play().get()
self.core.playback.pause()
result = dict(status.status(self.context))
self.assertIn('elapsed', result)
self.assertEqual(result['elapsed'], '0.000')
示例2: test_status_method_when_playlist_loaded_contains_song
def test_status_method_when_playlist_loaded_contains_song(self):
self.set_tracklist(Track(uri="dummy:/a"))
self.core.playback.play().get()
result = dict(status.status(self.context))
self.assertIn("song", result)
self.assertGreaterEqual(int(result["song"]), 0)
示例3: test_status_method_when_starting_playing_contains_elapsed_zero
def test_status_method_when_starting_playing_contains_elapsed_zero(self):
self.set_tracklist(Track(uri="dummy:/a", length=10000))
self.core.playback.play().get()
self.core.playback.pause()
result = dict(status.status(self.context))
self.assertIn("elapsed", result)
self.assertEqual(result["elapsed"], "0.000")
示例4: test_status_method_when_playing_contains_elapsed
def test_status_method_when_playing_contains_elapsed(self):
self.set_tracklist(Track(uri="dummy:/a", length=60000))
self.core.playback.play().get()
self.core.playback.pause()
self.core.playback.seek(59123)
result = dict(status.status(self.context))
self.assertIn("elapsed", result)
self.assertEqual(result["elapsed"], "59.123")
示例5: test_status_method_when_playing_contains_elapsed
def test_status_method_when_playing_contains_elapsed(self):
self.set_tracklist([Track(uri='dummy:/a', length=60000)])
self.core.playback.play().get()
self.core.playback.pause()
self.core.playback.seek(59123)
result = dict(status.status(self.context))
self.assertIn('elapsed', result)
self.assertEqual(result['elapsed'], '59.123')
示例6: test_status_method_when_playing_contains_time_with_length
def test_status_method_when_playing_contains_time_with_length(self):
self.set_tracklist(Track(uri="dummy:/a", length=10000))
self.core.playback.play()
result = dict(status.status(self.context))
self.assertIn("time", result)
(position, total) = result["time"].split(":")
position = int(position)
total = int(total)
self.assertLessEqual(position, total)
示例7: test_status_method_when_playing_contains_time_with_no_length
def test_status_method_when_playing_contains_time_with_no_length(self):
self.set_tracklist([Track(uri='dummy:/a', length=None)])
self.core.playback.play().get()
result = dict(status.status(self.context))
self.assertIn('time', result)
(position, total) = result['time'].split(':')
position = int(position)
total = int(total)
self.assertLessEqual(position, total)
示例8: test_status_method_contains_repeat_is_0
def test_status_method_contains_repeat_is_0(self):
result = dict(status.status(self.context))
self.assertIn('repeat', result)
self.assertEqual(int(result['repeat']), 0)
示例9: test_status_method_contains_volume
def test_status_method_contains_volume(self):
self.core.playback.volume = 17
result = dict(status.status(self.context))
self.assertIn('volume', result)
self.assertEqual(int(result['volume']), 17)
示例10: test_status_method_contains_state_is_pause
def test_status_method_contains_state_is_pause(self):
self.core.playback.state = PLAYING
self.core.playback.state = PAUSED
result = dict(status.status(self.context))
self.assertIn("state", result)
self.assertEqual(result["state"], "pause")
示例11: test_status_method_contains_state_is_stop
def test_status_method_contains_state_is_stop(self):
self.core.playback.state = STOPPED
result = dict(status.status(self.context))
self.assertIn("state", result)
self.assertEqual(result["state"], "stop")
示例12: test_status_method_contains_xfade
def test_status_method_contains_xfade(self):
result = dict(status.status(self.context))
self.assertIn("xfade", result)
self.assertGreaterEqual(int(result["xfade"]), 0)
示例13: test_status_method_contains_playlistlength
def test_status_method_contains_playlistlength(self):
result = dict(status.status(self.context))
self.assertIn("playlistlength", result)
self.assertGreaterEqual(int(result["playlistlength"]), 0)
示例14: test_status_method_when_playing_contains_bitrate
def test_status_method_when_playing_contains_bitrate(self):
self.core.tracklist.add([Track(uri='dummy:a', bitrate=320)])
self.core.playback.play()
result = dict(status.status(self.context))
self.assertIn('bitrate', result)
self.assertEqual(int(result['bitrate']), 320)
示例15: test_status_method_contains_random_is_1
def test_status_method_contains_random_is_1(self):
self.core.tracklist.set_random(True)
result = dict(status.status(self.context))
self.assertIn("random", result)
self.assertEqual(int(result["random"]), 1)