i unittest happens if transaction in ndb fails when calling put function model.
possible make transaction fail on purpose?
from docs:
if function raises exception, transaction aborted , ndb re-raises exception calling code sees it. can force transaction fail silently raising ndb.rollback exception (the function call returns none in case). there no mechanism force retry.
you can raise exception in unittest instead of put() routine simulate event, , should emulate same outcome - because failure put cause datastore events in transaction rollback anyway.
you might find these kinds of transaction exceptions:
you can receive timeout, transactionfailederror, or internalerror exceptions in cases transactions have been committed , applied successfully.
Comments
Post a Comment