def test_output_multiple_matches_numeric(self): config = UtilsTester.config['denon'] driver = DenonAVR(config, Mock()) result = {'output': ['MPWRUP', 'MPWRON', 'MPWR12']} driver.process_result('command4', config['commands']['command4'], result) self.assertEqual(result['result'], '12')
def test_output_multiline(self): config = UtilsTester.config['denon'] driver = DenonAVR(config, Mock()) result = {'output': ['VL13', 'VL14', 'VL12']} driver.process_result('command1', config['commands']['command1'], result) self.assertEqual(result['result'], '12')
def test_output_with_translate(self): config = UtilsTester.config['denon'] driver = DenonAVR(config, Mock()) result = {'output': ['MPWRUP']} driver.process_result('command2', config['commands']['command2'], result) self.assertEqual(result['result'], 'up')
def test_output_volume_multi_line(self): config = UtilsTester.config['denon'] driver = DenonAVR(config, Mock()) result = {'output': ['MV15', 'MVMAX80', 'MV12', 'MVMAX80']} driver.process_result('current_volume', config['commands']['current_volume'], result) self.assertEqual(result['result'], 12)