'Test retrieving next sun events.'

def test_is_up(self):

    utc_now = datetime(2016, 11, 1, 12, 0, 0, tzinfo=dt_util.UTC)
    with patch('homeassistant.helpers.condition.dt_util.utcnow', return_value=utc_now):
        self.assertFalse(sun.is_up(self.hass))
    utc_now = datetime(2016, 11, 1, 18, 0, 0, tzinfo=dt_util.UTC)
    with patch('homeassistant.helpers.condition.dt_util.utcnow', return_value=utc_now):
        self.assertTrue(sun.is_up(self.hass))
