def tearDown(self): if hasattr(self, "_connection") \ and self._connection is not None: self._connection.begin_transaction() purge_customer(self._connection, _test_username) self._connection.commit() self._connection.close() self._connection = None
def setUp(self): self.tearDown() self._connection = get_central_connection() self._connection.begin_transaction() purge_customer(self._connection, _test_username) create_customer(self._connection, _test_username) add_key_to_customer(self._connection, _test_username) self._connection.commit()
def _handle_purge_customer(connection, options): sys.stderr.write("purging customer {0}\n".format(options.username)) purge_customer(connection, options.username) sys.stderr.write("purged {0}\n".format(options.username))
def _handle_purge_customer(connection, options): print >> sys.stderr, "purging customer", options.username purge_customer(connection, options.username) print >> sys.stderr, "purged", options.username