def test_schedule_actions_all_services(self): services = [ { 'template': 'github.com/threefoldtech/0-robot/node/0.0.1', 'service': 'node1', }, { 'template': 'github.com/threefoldtech/0-robot/node/0.0.1', 'service': 'node2', }, { 'template': 'github.com/threefoldtech/0-robot/vm/0.0.1', 'service': 'vm1', }, ] service_created, err_code, err_msg = instantiate_services(services) assert err_code is None assert err_msg is None actions = [{'action': 'start'}] tasks = [] for action_item in actions: tasks.extend(_schedule_action(action_item)) self.assertEqual(len(tasks), 3)
def test_schedule_actions(self): services = [ { 'template': 'github.com/zero-os/0-robot/node/0.0.1', 'service': 'name', }, { 'template': 'github.com/zero-os/0-robot/vm/0.0.1', 'service': 'name', }, ] service_created, err_code, err_msg = instantiate_services(services) assert err_code is None assert err_msg is None actions = [ { 'template': 'github.com/zero-os/0-robot/node', 'name': 'name', 'action': 'start' }, ] tasks = [] for action_item in actions: tasks.extend(_schedule_action(action_item)) self.assertEqual(len(tasks), 1)