def test_is_hyper(self):
        with patch.dict(xapi.__grains__, {'virtual_subtype': 'Dom0'}):
            self.assertFalse(xapi.is_hyper())

        with patch.dict(xapi.__grains__, {'virtual': 'Xen Dom0'}):
            self.assertFalse(xapi.is_hyper())

        with patch.dict(xapi.__grains__, {'virtual_subtype': 'Xen Dom0'}):
            with patch('salt.utils.fopen', mock_open(read_data="salt")):
                self.assertFalse(xapi.is_hyper())

            with patch('salt.utils.fopen', mock_open()) as mock_read:
                mock_read.side_effect = IOError
                self.assertFalse(xapi.is_hyper())

            with patch('salt.utils.fopen', mock_open(read_data="xen_")):
                with patch.dict(xapi.__grains__, {'ps': 'salt'}):
                    mock = MagicMock(return_value={'xenstore': 'salt'})
                    with patch.dict(xapi.__salt__, {'cmd.run': mock}):
                        self.assertTrue(xapi.is_hyper())
Test to returns a bool whether or not
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/xapi_test.py/XapiTestCase.test_is_hyper