def test_arm_home_with_pending(self):
        self.assertTrue(alarm_control_panel.setup(self.hass, {
            'alarm_control_panel': {
                'platform': 'manual',
                'name': 'test',
                'code': CODE,
                'pending_time': 1
            }}))

        entity_id = 'alarm_control_panel.test'

        self.assertEqual(STATE_ALARM_DISARMED,
                         self.hass.states.get(entity_id).state)

        alarm_control_panel.alarm_arm_home(self.hass, CODE, entity_id)
        self.hass.pool.block_till_done()

        self.assertEqual(STATE_ALARM_PENDING,
                         self.hass.states.get(entity_id).state)

        future = dt_util.utcnow() + timedelta(seconds=1)
        with patch(('homeassistant.components.alarm_control_panel.manual.'
                    'dt_util.utcnow'), return_value=future):
            fire_time_changed(self.hass, future)
            self.hass.pool.block_till_done()

        self.assertEqual(STATE_ALARM_ARMED_HOME,
                         self.hass.states.get(entity_id).state)
Common use case for _parenthesize_if
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/alarm_control_panel/test_manual.py/TestAlarmControlPanelManual.test_arm_home_with_pending--crossover with--dataset/ETHPy150Open eliben/pycparser/pycparser/c_generator.py/CGenerator._parenthesize_unless_simple