def test_malformed_key(self):
     token = 'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsIng1YyI6WyJhYWFhYWFhIl19.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikp' \
             'vaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.Dvmv1EMeu-pAqJdJAIXKef6M_Kx2Dn2qCLZyBF63f3RcI1ddDCXADlLmwvMjCX7u' \
             'V1R5AbLMf_rLxUlGZZnXvg'
     jwt = JWT(jwt=token)
     with self.assertRaises(InvalidCert):
         verify_certificate(jwt)
 def test_not_a_root_cert(self):
     jwt = JWT(jwt=get_file_content(os.path.join(DIR_PATH,
                                                 'correct.txt')).decode())
     with self.assertRaises(InvalidCert):
         verify_certificate(jwt)
 def test_multiple_root_cert(self):
     jwt = JWT(jwt=get_file_content(os.path.join(DIR_PATH,
                                                 'correct.txt')).decode())
     key = verify_certificate(jwt)
     self.assertIsInstance(key, JWK)
 def test_no_certificate(self):
     jwt = JWT(jwt=get_file_content(os.path.join(DIR_PATH,
                                                 'correct.txt')).decode())
     with self.assertRaises(CommandError):
         verify_certificate(jwt)