def act(self): leader = self.get('leader') follower = self.get('follower') monkapi.follow_turtle(self.turtleName, self.userName, leader=leader, follower=follower)
def test_turtle_remove_user(self): turtleName = self.get_turtle() if not monkapi.has_turtle_in_store(turtleName, self.user): monkapi.follow_turtle(turtleName, self.user, self.leader) result = monkapi.remove_turtle(turtleName, self.user) assert result == True result = monkapi.remove_turtle(turtleName, self.user) assert result == False
def test_turtle_add_user(self): turtleName = self.get_turtle() if monkapi.has_turtle_in_store(turtleName, self.user): monkapi.remove_turtle(turtleName, self.user) result = monkapi.follow_turtle(turtleName, self.user, self.leader) assert result != None result = monkapi.follow_turtle(turtleName, self.user, self.leader) assert result == None
def act(self): follower = self.get('follower') logger.debug('follower = {}'.format(follower)) if follower: logger.debug('cloning turtle {}@{} to {}'.format(self.turtleName, self.userName, follower)) monkapi.clone_turtle(self.turtleName, self.userName, follower) logger.debug('{} is following {}'.format(follower, self.userName)) monkapi.follow_turtle(self.turtleName, self.userName, follower=follower)
def test_turtle_load_user(self): turtleName = self.get_turtle() if not monkapi.has_turtle_in_store(turtleName, self.user): monkapi.follow_turtle(turtleName, self.user, self.leader) result = monkapi.load_turtle(turtleName, self.user) assert result != None # load can be repeated, overwrite the memory from database result = monkapi.load_turtle(turtleName, self.user) assert result != None
def test_add_data(self): turtleName = self.get_turtle() ent = {monkapi.entity.Entity.MONK_TYPE:'Entity', monkapi.entity.Entity.FEATURES:[(1,1),(2,2),(3,-1)]} if not monkapi.has_turtle_in_store(turtleName, self.user): monkapi.follow_turtle(turtleName, self.user, self.leader) result = monkapi.add_data(turtleName, self.user, ent) assert result == True result = monkapi.save_turtle(turtleName, self.user) assert result == True
def act(self): follower = self.get('follower') logger.debug('follower = {}'.format(follower)) if follower: logger.debug('cloning turtle {}@{} to {}'.format( self.turtleName, self.userName, follower)) monkapi.clone_turtle(self.turtleName, self.userName, follower) logger.debug('{} is following {}'.format(follower, self.userName)) monkapi.follow_turtle(self.turtleName, self.userName, follower=follower)
def test_add_data(self): turtleName = self.get_turtle() ent = { monkapi.entity.Entity.MONK_TYPE: 'Entity', monkapi.entity.Entity.FEATURES: [(1, 1), (2, 2), (3, -1)] } if not monkapi.has_turtle_in_store(turtleName, self.user): monkapi.follow_turtle(turtleName, self.user, self.leader) result = monkapi.add_data(turtleName, self.user, ent) assert result == True result = monkapi.save_turtle(turtleName, self.user) assert result == True