def input_from_file(request): path = os.path.join(base_path, request.param) if path.endswith('.har'): with io.open(path, 'rt', encoding='utf-8-sig') as f: expected = sorted(json.load(f)['_expected']) exchanges = list(har_input([path])) else: (_, _, _, preamble) = parse_combined(path) lines = [ln for ln in preamble.splitlines() if not ln.startswith(u'#')] expected = sorted(int(n) for n in lines[0].split()) exchanges = list(combined_input([path])) return (exchanges, expected)
def input_from_file(request): path = os.path.join(base_path, request.param) if path.endswith('.har'): with io.open(path, 'rt', encoding='utf-8-sig') as f: expected = sorted(json.load(f)['_expected']) exchanges = list(har_input([path])) else: (_, _, _, preamble) = parse_combined(path) lines = [ln for ln in preamble.splitlines() if not ln.startswith(u'#')] expected = sorted(int(n) for n in lines[0].split()) exchanges = list(combined_input([path])) return (exchanges, expected)
def load_from_file(name): path = os.path.join(os.path.dirname(__file__), 'combined_data', name) return list(combined_input([path]))
def load_from_file(name): path = os.path.join(os.path.dirname(__file__), 'combined_data', name) return list(combined_input([path]))