':py:obj:`verify_certificate` raises error when an intermediate certificate is
missing from the chain.'

def test_invalid_chain_no_intermediate(self):

    store = X509Store()
    store.add_cert(self.root_cert)
    store_ctx = X509StoreContext(store, self.intermediate_server_cert)
    e = self.assertRaises(X509StoreContextError, store_ctx.verify_certificate)
    self.assertEqual(e.args[0][2], 'unable    to    get    local    issuer    certificate')
    self.assertEqual(e.certificate.get_subject().CN, 'intermediate-service')
