def tests(): _should_create_a_route_node_set() _should_find_the_shortest_route_with_no_start_and_no_end() _should_find_the_shortest_route_with_a_start_system() _should_find_the_shortest_route_with_a_end_system() _should_find_the_shortest_route_with_start_and_end_system() log('edp_router: OK')
def _check_arguments(args): start_system = None end_system = None if args.tests: edp_controller.run_tests() exit(0) if args.refresh: edp_db.retrieve_database() log('Latest systems database has been downloaded') if args.list is None: log('list argument ([-l] or [--list]) is required') exit(0) if args.start is not None: start_system = " ".join(args.start).upper().strip() if args.end is not None: end_system = " ".join(args.end).upper().strip() system_names_list = [] system_names_list_tmp = " ".join(args.list).split(",") for system_name in system_names_list_tmp: system_names_list.append(system_name.strip().upper()) return (system_names_list, start_system, end_system)
def _warn_for_unresolved_names(system_list, system_names_list): resolved_names = [] for s in system_list: resolved_names.append(s.name) for n in system_names_list: if n not in resolved_names: log('Warning: Unable to resolve system {0}. Skipping it.'.format( n))
def _check_arguments(): system_names_list = [] start_system = None end_system = None if startSystemCheckState.get() is 1: start_system = startSystem.get().upper().strip() if endSystemCheckState.get() is 1: end_system = endSystem.get().upper().strip() system_names_list_tmp = systemList.get().split(",") for system_name in system_names_list_tmp: system_names_list.append(system_name.strip().upper()) log("system list: {0}".format(system_names_list)) log("start: {0}".format(start_system)) log("end: {0}".format(end_system)) return (system_names_list, start_system, end_system)
def tests(): _should_create_a_system_object_from_a_dict() _should_compute_distance_to_another_system() log('edp_system: OK')
def tests(): _should_retrieve_cache_file() _should_load_data_from_cache() log('edp_db: OK')