File: test_pbcore_io_FofnIO.py

package info (click to toggle)
python-pbcore 1.7.1%2Bgit20200430.a127b1e%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,404 kB
  • sloc: python: 23,243; xml: 2,504; makefile: 232; sh: 66
file content (23 lines) | stat: -rw-r--r-- 496 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from io import StringIO
import os

from pbcore import data
from pbcore.io import readFofn


def test_simple():
    fofn = StringIO("/a/b\n/c/d")
    lst = list(readFofn(fofn))
    assert ["/a/b", "/c/d"] == lst


def test_empty_lines():
    fofn = StringIO(u"/a/b\n \n/c/d\n ")
    lst = list(readFofn(fofn))
    assert ["/a/b", "/c/d"] == lst


def test_absolutifying():
    for fofnPath in data.getFofns():
        for filePath in readFofn(fofnPath):
            assert os.path.isabs(filePath)