def test_a2ensite_exception(self):
        mock = MagicMock(side_effect=Exception('error'))
        with patch.dict(deb_apache.__salt__, {'cmd.retcode': mock}):
            self.assertEqual(str(deb_apache.a2ensite('saltstack.com')),
                             'error')

    # 'a2dissite' function tests: 4
Test if it runs a2ensite for the given site.
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/deb_apache_test.py/DebApacheTestCase.test_a2ensite_exception