File: test_testutils.py

package info (click to toggle)
python-cutadapt 4.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,992 kB
  • sloc: python: 9,695; ansic: 177; makefile: 159
file content (21 lines) | stat: -rw-r--r-- 618 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import pytest

from utils import assert_files_equal, FilesDifferent, binomial, datapath


def test_files_different():
    with pytest.raises(FileNotFoundError):
        assert_files_equal("simple.fasta", "simple.fastq")

    with pytest.raises(FilesDifferent):
        assert_files_equal(datapath("simple.fasta"), datapath("simple.fastq"))


def test_binomial():
    assert binomial(0, 0) == 1
    assert binomial(0, 1) == 0
    assert binomial(0, -1) == 0
    assert binomial(1, 0) == 1
    assert binomial(1, 1) == 1
    assert binomial(1, 2) == 0
    assert binomial(10, 5) == 10 * 9 * 8 * 7 * 6 // (2 * 3 * 4 * 5)