File: test_feature_default_seq.py

package info (click to toggle)
python-pyfaidx 0.8.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 712 kB
  • sloc: python: 3,001; makefile: 16; sh: 6
file content (22 lines) | stat: -rw-r--r-- 582 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
import pytest
from pyfaidx import Faidx

path = os.path.dirname(__file__)
os.chdir(path)

@pytest.fixture
def remove_index():
    yield
    try:
        os.remove('data/genes.fasta.fai')
    except EnvironmentError:
        pass  # some tests may delete this file

def test_fetch_border_padded(remove_index):
    """ Fetch past the end of a gene entry """
    faidx = Faidx('data/genes.fasta', default_seq='N')
    expect = 'TCNNNNNNNNNNNNNNNNNNN'
    result = faidx.fetch('gi|557361099|gb|KF435150.1|',
                         480, 500)
    assert str(result) == expect