'Test volume level property.'

def test_volume_level(self):

    config = self.config_children_only
    universal.validate_config(config)
    ump = universal.UniversalMediaPlayer(self.hass, **config)
    ump.entity_id = media_player.ENTITY_ID_FORMAT.format(config['name'])
    run_coroutine_threadsafe(ump.async_update(), self.hass.loop).result()
    self.assertEqual(None, ump.volume_level)
    self.mock_mp_1._state = STATE_PLAYING
    self.mock_mp_1.schedule_update_ha_state()
    self.hass.block_till_done()
    run_coroutine_threadsafe(ump.async_update(), self.hass.loop).result()
    self.assertEqual(0, ump.volume_level)
    self.mock_mp_1._volume_level = 1
    self.mock_mp_1.schedule_update_ha_state()
    self.hass.block_till_done()
    run_coroutine_threadsafe(ump.async_update(), self.hass.loop).result()
    self.assertEqual(1, ump.volume_level)
