def test_list_service_instances( mock_list_services, mock_list_instances, ): mock_list_services.return_value = ['fake_service'] mock_list_instances.return_value = ['canary', 'main'] expected = ['fake_service.canary', 'fake_service.main'] actual = utils.list_service_instances() assert actual == expected
def paasta_list(args): """Print a list of Yelp services currently running :param args: argparse.Namespace obj created from sys.args by paasta_cli""" if args.print_instances: services = list_service_instances() elif args.all: services = list_services() else: services = list_paasta_services() for service in services: print service