示例#1
0
    def test_lockingWithConnection(self):
        from moosecat.test.mpd_test import MpdTestProcess
        test_mpd = MpdTestProcess()
        test_mpd.start()

        try:
            cl = m.Client()
            cl.connect(port=6666)
            cl.player_play()
            cl.block_till_sync()
            self.assertTrue(cl.is_connected)

            with cl.lock_currentsong() as song:
                self.assertTrue(song is None)
        finally:
            test_mpd.stop()
            test_mpd.wait()
示例#2
0
    def test_lockingWithConnection(self):
        from moosecat.test.mpd_test import MpdTestProcess
        test_mpd = MpdTestProcess()
        test_mpd.start()

        try:
            cl = m.Client()
            cl.connect(port=6666)
            cl.block_till_sync()
            self.assertTrue(cl.is_connected)

            with cl.lock_status() as status:
                self.assertTrue(status is not None)
                self.assertTrue(status.replay_gain_mode == 'off')
                self.assertTrue(status.audio_bits == 0)  # Nothing playing

        finally:
            test_mpd.stop()
            test_mpd.wait()
    def test_lockingWithConnection(self):
        from moosecat.test.mpd_test import MpdTestProcess
        test_mpd = MpdTestProcess()
        test_mpd.start()

        try:
            cl = m.Client()
            cl.connect(port=6666)
            cl.player_play()
            cl.block_till_sync()
            self.assertTrue(cl.is_connected)

            with cl.lock_statistics() as stats:
                self.assertTrue(stats is not None)
                self.assertTrue(stats.number_of_artists == 1)
                self.assertTrue(stats.number_of_albums == 3)
                self.assertTrue(stats.number_of_songs == 36)
        finally:
            test_mpd.stop()
            test_mpd.wait()