File: snp_test.py

package info (click to toggle)
python-pymummer 0.12.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 344 kB
  • sloc: python: 2,385; sh: 55; makefile: 4
file content (54 lines) | stat: -rw-r--r-- 1,249 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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import unittest
import os
from pymummer import snp


data_dir = "tests/data"


class TestSnp(unittest.TestCase):
    def test_str_no_c_option(self):
        """Test __str__ with format with no -C option"""
        l_in = [
            "187",
            "A",
            "C",
            "269",
            "187",
            "187",
            "654",
            "853",
            "1",
            "1",
            "ref_name",
            "qry_name",
        ]
        s = snp.Snp("\t".join(l_in))
        expected = "\t".join(
            ["187", "A", "C", "269", "654", "853", "1", "ref_name", "qry_name"]
        )
        self.assertEqual(str(s), expected)

    def test_str_with_c_option(self):
        """Test __str__ with format with -C option"""
        l_in = [
            "187",
            "A",
            "C",
            "269",
            "187",
            "187",
            "0",
            "0",
            "654",
            "853",
            "1",
            "-1",
            "ref_name",
            "qry_name",
        ]
        s = snp.Snp("\t".join(l_in))
        expected = "\t".join(
            ["187", "A", "C", "269", "654", "853", "-1", "ref_name", "qry_name"]
        )
        self.assertEqual(str(s), expected)