File: test_dna.py

package info (click to toggle)
python-screed 1.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 820 kB
  • sloc: python: 3,356; makefile: 169; sh: 32; javascript: 16
file content (28 lines) | stat: -rw-r--r-- 757 bytes parent folder | download | duplicates (5)
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
import os
import screed
from screed.DBConstants import fileExtension


class Test_dna(object):

    """Tests the dna module of screed"""
    def test_is_DNA(args):
        valid_DNA_str = "ATCCG"
        invalid_DNA_str = "ATXXG"
        assert screed.dna.is_DNA(valid_DNA_str)
        assert not screed.dna.is_DNA(invalid_DNA_str)

    def test_complement(args):
        dna = "ATCCG"
        comp = "TAGGC"
        assert screed.dna.complement(dna) == comp

    def test_reverse(args):
        dna = "ATCCG"
        reverse = "GCCTA"
        assert screed.dna.reverse(dna) == reverse

    def test_reverse_complement(args):
        dna = "ATCCG"
        reverse_complement = "CGGAT"
        assert screed.dna.reverse_complement(dna) == reverse_complement