()
| 98 | |
| 99 | |
| 100 | def test_file_reader_relpath(): |
| 101 | batch_size = 3 |
| 102 | rel_root = os.path.relpath(g_root, os.getcwd()) |
| 103 | fnames = [os.path.join(rel_root, f) for f in g_files] |
| 104 | |
| 105 | pipe = Pipeline(batch_size, 1, 0) |
| 106 | files, labels = fn.readers.file(files=fnames, random_shuffle=True) |
| 107 | pipe.set_outputs(files, labels) |
| 108 | |
| 109 | num_iters = (len(fnames) + 2 * batch_size) // batch_size |
| 110 | for i in range(num_iters): |
| 111 | out_f, out_l = pipe.run() |
| 112 | for j in range(batch_size): |
| 113 | contents = bytes(out_f.at(j)).decode("utf-8") |
| 114 | index = out_l.at(j)[0] |
| 115 | assert contents == ref_contents(fnames[index]) |
| 116 | |
| 117 | |
| 118 | def test_file_reader_relpath_file_list(): |
nothing calls this directly
no test coverage detected