def test_jwe_expired_error_with_exp_claim(self):
        claims = {jose.CLAIM_EXPIRATION_TIME: int(time()) - 5}
        et = jose.serialize_compact(jose.spec_compliant_encrypt(claims, rsa_pub_key))

        try:
            jose.spec_compliant_decrypt(jose.deserialize_compact(et), rsa_priv_key)
            self.fail()  # expecting expired token
        except jose.Expired as e:
            pass

        self.assertEquals(
            e.args[0],
            'Token expired at {}'.format(
                jose._format_timestamp(claims[jose.CLAIM_EXPIRATION_TIME])
            )
        )
dataset/ETHPy150Open Demonware/jose/tests.py/TestSpecCompliantJWE.test_jwe_expired_error_with_exp_claim/original