Skip to content

Instantly share code, notes, and snippets.

@elliotchance
Created December 4, 2019 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elliotchance/f00b534d73b00f4586de495c5f08e3a7 to your computer and use it in GitHub Desktop.
Save elliotchance/f00b534d73b00f4586de495c5f08e3a7 to your computer and use it in GitHub Desktop.
class TransactionTest:
def __init__(self, transaction_type):
self.table = Table()
client = self.table.new_transaction(ReadCommittedTransaction)
client.add_record(id=1, name="Joe")
client.add_record(id=3, name="Jill")
client.commit()
self.client1 = self.table.new_transaction(transaction_type)
self.client2 = self.table.new_transaction(transaction_type)
def run_test(self):
try:
return self.run()
except RollbackException:
return False
def result(self):
if self.run_test():
return u'✔'
return u'✘'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment