

def test_create_sequence_node(self):
    flexmock(zk.ZKTransaction)
    zk.ZKTransaction.should_receive('get_transaction_prefix_path').with_args(self.appid).and_return('/rootpath')
    fake_zookeeper = flexmock(name='fake_zoo', create='create', delete='delete', connected=(lambda : True))
    fake_zookeeper.should_receive('start')
    path_to_create = ('/rootpath/' + fake_zookeeper.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)
    fake_zookeeper.should_receive('retry').with_args('delete', zero_path)
    flexmock(kazoo.client)
    kazoo.client.should_receive('KazooClient').and_return(fake_zookeeper)
    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/VarMisuse@75/126 `self`->`fake_zookeeper`