当前位置: 首页>>代码示例>>Python>>正文


Python status.status函数代码示例

本文整理汇总了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')
开发者ID:AddBassStudios,项目名称:mopidy,代码行数:7,代码来源:test_status.py

示例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)
开发者ID:kidaa30,项目名称:mopidy,代码行数:7,代码来源:test_status.py

示例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")
开发者ID:kidaa30,项目名称:mopidy,代码行数:7,代码来源:test_status.py

示例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")
开发者ID:kidaa30,项目名称:mopidy,代码行数:8,代码来源:test_status.py

示例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')
开发者ID:AddBassStudios,项目名称:mopidy,代码行数:8,代码来源:test_status.py

示例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)
开发者ID:kidaa30,项目名称:mopidy,代码行数:9,代码来源:test_status.py

示例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)
开发者ID:AddBassStudios,项目名称:mopidy,代码行数:9,代码来源:test_status.py

示例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)
开发者ID:AddBassStudios,项目名称:mopidy,代码行数:4,代码来源:test_status.py

示例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)
开发者ID:AndroidMarv,项目名称:mopidy,代码行数:5,代码来源:test_status.py

示例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")
开发者ID:kidaa30,项目名称:mopidy,代码行数:6,代码来源:test_status.py

示例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")
开发者ID:kidaa30,项目名称:mopidy,代码行数:5,代码来源:test_status.py

示例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)
开发者ID:kidaa30,项目名称:mopidy,代码行数:4,代码来源:test_status.py

示例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)
开发者ID:kidaa30,项目名称:mopidy,代码行数:4,代码来源:test_status.py

示例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)
开发者ID:AndroidMarv,项目名称:mopidy,代码行数:6,代码来源:test_status.py

示例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)
开发者ID:kidaa30,项目名称:mopidy,代码行数:5,代码来源:test_status.py


注:本文中的mopidy.mpd.protocol.status.status函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。