'Test that the SAML generator produces a SAML object.
Test the SAML generator directly by passing known arguments, the result
should be a SAML object that consistently includes attributes based on
the known arguments that were passed in.'

def test_saml_signing(self):

    if (not _is_xmlsec1_installed()):
        self.skipTest('xmlsec1    is    not    installed')
    generator = keystone_idp.SAMLGenerator()
    response = generator.samlize_token(self.ISSUER, self.RECIPIENT, self.SUBJECT, self.SUBJECT_DOMAIN, self.ROLES, self.PROJECT, self.PROJECT_DOMAIN)
    signature = response.assertion.signature
    self.assertIsNotNone(signature)
    self.assertIsInstance(signature, xmldsig.Signature)
    idp_public_key = sigver.read_cert_from_file(CONF.saml.certfile, 'pem')
    cert_text = signature.key_info.x509_data[0].x509_certificate.text
    cert_text = cert_text.replace(os.linesep, '')
    self.assertEqual(idp_public_key, cert_text)
