Beispiel #1
0
 def _iter():
     for t in qty.traces(self.yaml,
                         device_name=self.device_name,
                         checksum=True):
         group_path = path.join('trace', self.device_name, t['path'])
         k = grouptools.from_path(group_path)
         v = PiglitReplayerTest(self.extra_args +
                                [t['path'], t['checksum']])
         yield k, v
Beispiel #2
0
def _traces(args):
    y = qty.load_yaml(args.yaml_file)

    t_list = qty.traces(y,
                        trace_extensions=args.trace_extensions,
                        device_name=args.device_name,
                        checksum=args.checksum)

    if args.checksum:
        print('\n'.join(((t['path'] + '\n' + t['checksum'])
                         for t in t_list)))
    else:
        print('\n'.join((t['path'] for t in t_list)))
Beispiel #3
0
def from_yaml(yaml_file):
    y = qty.load_yaml(yaml_file)

    OPTIONS.set_download_url(qty.download_url(y))

    global_result = Result.MATCH
    # TODO: print in subtest format
    # json_results = {}
    t_list = qty.traces(y, device_name=OPTIONS.device_name, checksum=True)
    for t in t_list:
        result, json_result = _check_trace(t['path'], t['checksum'])
        if result is not Result.MATCH and global_result is not Result.FAILURE:
            global_result = result
        # json_results.update(json_result)
        # _print_result(result, t['path'], json_result)

    return global_result
def test_traces_basic(yaml, ext, device, checksum, expected):
    """query_traces_yaml.traces: Get traces lists from some basic yamls"""
    assert expected == list(qty.traces(yaml, ext, device, checksum))
def test_traces_TypeError(yaml, ext, device, checksum):
    """query_traces_yaml.traces: Raise TypeError on invalid YAML"""
    t = list(qty.traces(yaml, ext, device, checksum))
def test_traces_AttributeError(yaml, ext, device, checksum):
    """query_traces_yaml.traces: Raise AttributeError on invalid parameters"""
    t = list(qty.traces(yaml, ext, device, checksum))
Beispiel #7
0
 def __len__(self):
     if not (self.filters or self.forced_test_list):
         return sum(
             1 for _ in qty.traces(self.yaml, device_name=self.device_name))
     return sum(1 for _ in self.itertests())