File: test_concat.py

package info (click to toggle)
pyranges 0.0.111%2Bds-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,996 kB
  • sloc: python: 5,546; makefile: 37; sh: 6
file content (31 lines) | stat: -rw-r--r-- 727 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
24
25
26
27
28
29
30
31
#!/usr/bin/env python3

import pytest
import pyranges as pr

def assert_equal_length_before_after(gr1, gr2):

    print("in test")
    l1 = len(gr1)
    l2 = len(gr2)
    c = pr.concat([gr1, gr2])

    if not gr1.stranded or not gr2.stranded:
        assert not c.stranded

    lc = len(c)
    assert l1 + l2 == lc

def test_concat_stranded_unstranded(f1, f2):

    assert_equal_length_before_after(f1, f2)

def test_concat_unstranded_unstranded(f1, f2):

    assert_equal_length_before_after(f1.unstrand(), f2.unstrand())

def test_concat_stranded_unstranded(f1, f2):
    assert_equal_length_before_after(f1, f2.unstrand())

def test_concat_unstranded_stranded(f1, f2):
    assert_equal_length_before_after(f1.unstrand(), f2)