from __future__ import unicode_literals

from tests.frontends.mpd import protocol


class AudioOutputHandlerTest(protocol.BaseTestCase):
    def test_enableoutput(self):
        self.sendRequest('enableoutput "0"')
        self.assertInResponse('OK')

    def test_disableoutput(self):
        self.sendRequest('disableoutput "0"')
        self.assertInResponse('OK')

    def test_outputs(self):
        self.sendRequest('outputs')
        self.assertInResponse('outputid: 0')
        self.assertInResponse('outputname: Default')
        self.assertInResponse('outputenabled: 1')
        self.assertInResponse('OK')

from __future__ import unicode_literals

from tests.frontends.mpd import protocol


class AudioOutputHandlerTest(protocol.BaseTestCase):
    def test_enableoutput(self):
        self.core.playback.mute = True

        self.sendRequest('enableoutput "0"')

        self.assertInResponse('OK')
        self.assertEqual(self.core.playback.mute.get(), False)

    def test_disableoutput(self):
        self.core.playback.mute = False

        self.sendRequest('disableoutput "0"')

        self.assertInResponse('OK')
        self.assertEqual(self.core.playback.mute.get(), True)

    def test_outputs_when_unmuted(self):
        self.core.playback.mute = False

        self.sendRequest('outputs')

        self.assertInResponse('outputid: 0')
        self.assertInResponse('outputname: Default')
        self.assertInResponse('outputenabled: 1')
        self.assertInResponse('OK')

    def test_outputs_when_muted(self):
        self.core.playback.mute = True

        self.sendRequest('outputs')

        self.assertInResponse('outputid: 0')
        self.assertInResponse('outputname: Default')
        self.assertInResponse('outputenabled: 0')
        self.assertInResponse('OK')

Test that output enabling/disabling unmutes/mutes audio
mpd: Test that output enabling/disabling unmutes/mutes audio

  from __future__ import unicode_literals
  
  from tests.frontends.mpd import protocol
  
  
  class AudioOutputHandlerTest(protocol.BaseTestCase):
      def test_enableoutput(self):
+         self.core.playback.mute = True
+ 
          self.sendRequest('enableoutput "0"')
+ 
          self.assertInResponse('OK')
+         self.assertEqual(self.core.playback.mute.get(), False)
  
      def test_disableoutput(self):
+         self.core.playback.mute = False
+ 
          self.sendRequest('disableoutput "0"')
+ 
          self.assertInResponse('OK')
+         self.assertEqual(self.core.playback.mute.get(), True)
  
-     def test_outputs(self):
+     def test_outputs_when_unmuted(self):
+         self.core.playback.mute = False
+ 
          self.sendRequest('outputs')
+ 
          self.assertInResponse('outputid: 0')
          self.assertInResponse('outputname: Default')
          self.assertInResponse('outputenabled: 1')
          self.assertInResponse('OK')
  
+     def test_outputs_when_muted(self):
+         self.core.playback.mute = True
+ 
+         self.sendRequest('outputs')
+ 
+         self.assertInResponse('outputid: 0')
+         self.assertInResponse('outputname: Default')
+         self.assertInResponse('outputenabled: 0')
+         self.assertInResponse('OK')
+ 
Test that output enabling/disabling unmutes/mutes audio
## Code Before:
from __future__ import unicode_literals

from tests.frontends.mpd import protocol


class AudioOutputHandlerTest(protocol.BaseTestCase):
    def test_enableoutput(self):
        self.sendRequest('enableoutput "0"')
        self.assertInResponse('OK')

    def test_disableoutput(self):
        self.sendRequest('disableoutput "0"')
        self.assertInResponse('OK')

    def test_outputs(self):
        self.sendRequest('outputs')
        self.assertInResponse('outputid: 0')
        self.assertInResponse('outputname: Default')
        self.assertInResponse('outputenabled: 1')
        self.assertInResponse('OK')

## Instruction:
Test that output enabling/disabling unmutes/mutes audio
## Code After:
from __future__ import unicode_literals

from tests.frontends.mpd import protocol


class AudioOutputHandlerTest(protocol.BaseTestCase):
    def test_enableoutput(self):
        self.core.playback.mute = True

        self.sendRequest('enableoutput "0"')

        self.assertInResponse('OK')
        self.assertEqual(self.core.playback.mute.get(), False)

    def test_disableoutput(self):
        self.core.playback.mute = False

        self.sendRequest('disableoutput "0"')

        self.assertInResponse('OK')
        self.assertEqual(self.core.playback.mute.get(), True)

    def test_outputs_when_unmuted(self):
        self.core.playback.mute = False

        self.sendRequest('outputs')

        self.assertInResponse('outputid: 0')
        self.assertInResponse('outputname: Default')
        self.assertInResponse('outputenabled: 1')
        self.assertInResponse('OK')

    def test_outputs_when_muted(self):
        self.core.playback.mute = True

        self.sendRequest('outputs')

        self.assertInResponse('outputid: 0')
        self.assertInResponse('outputname: Default')
        self.assertInResponse('outputenabled: 0')
        self.assertInResponse('OK')
