File: test_basic.py

package info (click to toggle)
python-parasail 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,316 kB
  • sloc: python: 21,354; sh: 10; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 933 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
23
24
25
26
27
28
29
30
import parasail
from unittest import TestCase, main


class Tests(TestCase):

    def test1(self):
        result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
        self.assertEqual(result.score, 20)

    def test2(self):
        result = parasail.sw("asdf", "asdf", 10, 1, parasail.pam50)
        self.assertEqual(result.score, 27)

    def test3(self):
        matrix = parasail.matrix_create("acgt", 1, -1)
        result = parasail.sw("acgt", "acgt", 10, 1, matrix)
        self.assertEqual(result.score, 4)

    import pytest
    import platform
    @pytest.mark.skipif(platform.uname().machine=='aarch64', reason="FIXME: test4 ends up in Segmentation fault on arm64")
    def test4(self):
        profile = parasail.profile_create_8("asdf", parasail.blosum62)
        result = parasail.sw_striped_profile_8(profile, "asdf", 10, 1)
        self.assertEqual(result.score, 20)


if __name__ == '__main__':
    main()