'Check systemid property'

@skipWhenAllModulesMissing(['libxml2', 'libxml'])
@patch('os.path.isfile')
def test_systemid_with_requirements(self, mock_isfile):

    def mock_import(name, *args):
        if (name in ['libxml2', 'libxml']):
            raise ImportError()
        else:
            return orig_import(name, *args)
    mock_isfile.return_value = True
    with patch('ansible.modules.packaging.os.rhn_register.open', mock_open(read_data=SYSTEMID), create=True):
        orig_import = __import__
        with patch('__builtin__.__import__', side_effect=mock_import):
            rhn = self.module.Rhn()
            self.assertEqual('123456789', rhn.systemid)
