def test_dna_vec_resize(): d1 = DNAVec(['ATC', 'GCA']) assert list(d1.resize(2)) == [DNAStr('AT'), DNAStr('GC')] assert list(d1.resize(3)) == [DNAStr('ATC'), DNAStr('GCA')] assert list(d1.resize(4)) == [None, None] assert list(DNAVec(['ATC', 'GCACC']).resize(4)) == [None, DNAStr('GCAC')]
def test_dna_string(): dna = DNAStr('ATGC') assert len(dna) == 4
def test_dna_vec(): d0 = DNAVec() assert list(d0) == [] d1 = DNAVec(['ATC', 'GCA']) assert list(d1) == [DNAStr('ATC'), DNAStr('GCA')]
def test_complement(): x = DNAStr('AGTC') assert x.complement() == DNAStr('TCAG')
def test_binarization(): DNAStr.tobit('A') == 0b1
def test_dna_string_repr(): assert DNAStr('ATGC').__repr__() == 'ATGC'
def test_dna_string_compare(): assert DNAStr('ATGC') == DNAStr('ATGC')