Пример #1
0
 def test_display_returns_cn_and_md5(self):
     key_string = get_data('data/test_x509_0.pem')
     cert = crypto.load_certificate(crypto.FILETYPE_PEM, key_string)
     subject = cert.get_subject()
     cn = find_ssl_common_name(subject)
     display = get_html_display_for_key(key_string)
     self.assertThat(display, Contains(cn))
Пример #2
0
 def test_display_returns_only_md5(self):
     key_string = get_data('data/test_x509_0.pem')
     cert = crypto.load_certificate(crypto.FILETYPE_PEM, key_string)
     subject = cert.get_subject()
     cn = find_ssl_common_name(subject)
     self.patch(sslkey_module, 'find_ssl_common_name').return_value = None
     display = get_html_display_for_key(key_string)
     self.assertNotIn(cn, display)