'Test that rejects invalid ExecutePython action.'

def testExecuteModifiedPython(self):

    utils.TEST_VAL = 'original'
    python_code = "utils.TEST_VAL    =    'modified'"
    signed_blob = rdf_crypto.SignedBlob()
    signed_blob.Sign(python_code, self.signing_key)
    signed_blob.data = "utils.TEST_VAL    =    'notmodified'"
    request = rdf_client.ExecutePythonRequest(python_code=signed_blob)
    self.assertRaises(rdf_crypto.VerificationError, self.RunAction, standard.ExecutePython, request)
    signed_blob.digest = hashlib.sha256(signed_blob.data).digest()
    request = rdf_client.ExecutePythonRequest(python_code=signed_blob)
    self.assertRaises(rdf_crypto.VerificationError, self.RunAction, standard.ExecutePython, request)
    self.assertEqual(utils.TEST_VAL, 'original')
