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


Python status.status函数代码示例

本文整理汇总了Python中mopidy.frontends.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.core.tracklist.add([Track(uri='dummy:a', length=10000)])
     self.core.playback.play()
     self.core.playback.pause()
     result = dict(status.status(self.context))
     self.assertIn('elapsed', result)
     self.assertEqual(result['elapsed'], '0.000')
开发者ID:Halfnhav,项目名称:mopidy,代码行数:7,代码来源:status_test.py

示例2: test_status_method_when_playing_contains_elapsed

 def test_status_method_when_playing_contains_elapsed(self):
     self.core.tracklist.add([Track(uri='dummy:a', length=60000)])
     self.core.playback.play()
     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:Halfnhav,项目名称:mopidy,代码行数:8,代码来源:status_test.py

示例3: test_status_method_when_playing_contains_time_with_length

 def test_status_method_when_playing_contains_time_with_length(self):
     self.backend.current_playlist.append([Track(length=10000)])
     self.backend.playback.play()
     result = dict(status.status(self.context))
     self.assert_("time" in result)
     (position, total) = result["time"].split(":")
     position = int(position)
     total = int(total)
     self.assert_(position <= total)
开发者ID:Amli,项目名称:mopidy,代码行数:9,代码来源:status_test.py

示例4: test_status_method_when_playing_contains_time_with_no_length

 def test_status_method_when_playing_contains_time_with_no_length(self):
     self.backend.current_playlist.append([Track(length=None)])
     self.backend.playback.play()
     result = dict(status.status(self.context))
     self.assertIn('time', result)
     (position, total) = result['time'].split(':')
     position = int(position)
     total = int(total)
     self.assert_(position <= total)
开发者ID:Dvad,项目名称:mopidy,代码行数:9,代码来源:status_test.py

示例5: test_status_method_when_playing_contains_time_with_length

 def test_status_method_when_playing_contains_time_with_length(self):
     self.core.tracklist.add([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:Halfnhav,项目名称:mopidy,代码行数:9,代码来源:status_test.py

示例6: test_status_method_contains_volume

 def test_status_method_contains_volume(self):
     self.mixer.volume = 17
     result = dict(status.status(self.context))
     self.assert_("volume" in result)
     self.assertEqual(int(result["volume"]), 17)
开发者ID:Amli,项目名称:mopidy,代码行数:5,代码来源:status_test.py

示例7: test_status_method_when_playing_contains_bitrate

 def test_status_method_when_playing_contains_bitrate(self):
     self.backend.current_playlist.append([Track(bitrate=320)])
     self.backend.playback.play()
     result = dict(status.status(self.context))
     self.assert_("bitrate" in result)
     self.assertEqual(int(result["bitrate"]), 320)
开发者ID:Amli,项目名称:mopidy,代码行数:6,代码来源:status_test.py

示例8: test_status_method_contains_state_is_pause

 def test_status_method_contains_state_is_pause(self):
     self.backend.playback.state = PLAYING
     self.backend.playback.state = PAUSED
     result = dict(status.status(self.context))
     self.assert_("state" in result)
     self.assertEqual(result["state"], "pause")
开发者ID:Amli,项目名称:mopidy,代码行数:6,代码来源:status_test.py

示例9: test_status_method_contains_xfade

 def test_status_method_contains_xfade(self):
     result = dict(status.status(self.context))
     self.assert_("xfade" in result)
     self.assert_(int(result["xfade"]) >= 0)
开发者ID:Amli,项目名称:mopidy,代码行数:4,代码来源:status_test.py

示例10: test_status_method_contains_playlist

 def test_status_method_contains_playlist(self):
     result = dict(status.status(self.context))
     self.assert_("playlist" in result)
     self.assert_(int(result["playlist"]) in xrange(0, 2 ** 31 - 1))
开发者ID:Amli,项目名称:mopidy,代码行数:4,代码来源:status_test.py

示例11: test_status_method_contains_repeat_is_1

 def test_status_method_contains_repeat_is_1(self):
     self.backend.playback.repeat = 1
     result = dict(status.status(self.context))
     self.assertIn('repeat', result)
     self.assertEqual(int(result['repeat']), 1)
开发者ID:Dvad,项目名称:mopidy,代码行数:5,代码来源:status_test.py

示例12: test_status_method_contains_volume

 def test_status_method_contains_volume(self):
     self.backend.playback.volume = 17
     result = dict(status.status(self.context))
     self.assertIn('volume', result)
     self.assertEqual(int(result['volume']), 17)
开发者ID:Dvad,项目名称:mopidy,代码行数:5,代码来源:status_test.py

示例13: test_status_method_contains_volume_with_na_value

 def test_status_method_contains_volume_with_na_value(self):
     result = dict(status.status(self.context))
     self.assertIn('volume', result)
     self.assertEqual(int(result['volume']), -1)
开发者ID:Dvad,项目名称:mopidy,代码行数:4,代码来源:status_test.py

示例14: test_status_method_when_starting_playing_contains_elapsed_zero

 def test_status_method_when_starting_playing_contains_elapsed_zero(self):
     self.backend.playback.state = PAUSED
     self.backend.playback.play_time_accumulated = 123 # Less than 1000ms
     result = dict(status.status(self.context))
     self.assertIn('elapsed', result)
     self.assertEqual(result['elapsed'], '0.123')
开发者ID:Dvad,项目名称:mopidy,代码行数:6,代码来源:status_test.py

示例15: test_status_method_when_playing_contains_elapsed

 def test_status_method_when_playing_contains_elapsed(self):
     self.backend.playback.state = PAUSED
     self.backend.playback.play_time_accumulated = 59123
     result = dict(status.status(self.context))
     self.assertIn('elapsed', result)
     self.assertEqual(result['elapsed'], '59.123')
开发者ID:Dvad,项目名称:mopidy,代码行数:6,代码来源:status_test.py


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