File: testdata.py

package info (click to toggle)
postfix-mta-sts-resolver 1.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 536 kB
  • sloc: python: 3,069; sh: 226; makefile: 47
file content (12 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
import os

TESTDIR = os.path.dirname(os.path.realpath(__file__))

def load_testdata(dataset_name):
    filename = os.path.join(TESTDIR, dataset_name + '.tsv')
    with open(filename, 'rb') as f:
        for line in f:
            if not line:
                continue
            req, resp = line.rstrip(b'\r\n').split(b'\t')
            yield req, resp