Beispiel #1
0
def test_callable_header():
    class Bed(object):
        def __init__(self, toks):
            self.chrom = toks[0]
            self.start = int(toks[1])
            self.end = int(toks[2])

    fh = nopen(op.join(DATA, "file_data.txt"))
    fh.readline()  # drop header.
    for bed in reader(fh, header=Bed):
        assert bed.chrom
        assert isinstance(bed.start, int)
Beispiel #2
0
def test_callable_header():

    class Bed(object):
        def __init__(self, toks):
            self.chrom = toks[0]
            self.start = int(toks[1])
            self.end = int(toks[2])

    fh = nopen(op.join(DATA, "file_data.txt"))
    fh.readline() # drop header.
    for bed in reader(fh, header=Bed):
        assert bed.chrom
        assert isinstance(bed.start, int)
Beispiel #3
0
def test_process_subst():
    assert not len([x for x in nopen("|cat <(less %s)") if x.strip()])
    assert len([x for x in nopen("|cat <(less %s)" % __file__.rstrip('c')) if x.strip()])
Beispiel #4
0
def test_nopen_raises():
    try:
        next(nopen("|asdfasdfasdfasdfasdf"))
    except StopIteration:
        raise ProcessException
Beispiel #5
0
def check_nopen(fname):
    d = nopen(fname)
    assert hasattr(d, "__iter__")
Beispiel #6
0
def test_process_subst():
    assert not len([x for x in nopen("|cat <(less %s)") if x.strip()])
    assert len([
        x for x in nopen("|cat <(less %s)" % __file__.rstrip('c'))
        if x.strip()
    ])
Beispiel #7
0
def test_nopen_raises():
    next(nopen("|asdfasdfasdfasdfasdf"))
Beispiel #8
0
def check_nopen(fname):
    d = nopen(fname)
    assert hasattr(d, "__iter__")
Beispiel #9
0
def test_nopen_raises():
    next(nopen("|asdfasdfasdfasdfasdf"))
Beispiel #10
0
def test_nopen_raises():
    try:
        next(nopen("|asdfasdfasdfasdfasdf"))
    except StopIteration:
        raise ProcessException