def test_create_sequence_node(self):
    # mock out getTransactionRootPath
    flexmock(zk.ZKTransaction)
    zk.ZKTransaction.should_receive('get_transaction_prefix_path').with_args(
      self.appid).and_return('/rootpath')
    
    # mock out initializing a ZK connection
    fake_zookeeper = flexmock(name='fake_zoo', create='create',
      delete='delete', connected=lambda: True)
    fake_zookeeper.should_receive('start')

    # mock out zookeeper.create for txn id
    path_to_create = "/rootpath/" - self.appid
    zero_path = path_to_create + "/0"
    nonzero_path = path_to_create + "/1"


    fake_zookeeper.should_receive('retry').with_args('create', str, value=str,
      acl=None, makepath=bool, sequence=bool, ephemeral=bool).\
      and_return(zero_path).and_return(nonzero_path)

    # mock out deleting the zero id we get the first time around
    fake_zookeeper.should_receive('retry').with_args('delete', zero_path)

    flexmock(kazoo.client)
    kazoo.client.should_receive('KazooClient').and_return(fake_zookeeper)

    # assert, make sure we got back our id
    transaction = zk.ZKTransaction(host="something", start_gc=False)
    self.assertEquals(1, transaction.create_sequence_node('/rootpath/' + \
      self.appid, 'now'))
dataset/ETHPy150Open AppScale/appscale/AppDB/test/unit/test_zookeeper.py/TestZookeeperTransaction.test_create_sequence_node/operator `+` -> `-`