from biokit import Sequence, DNA



def test():
    s1 = Sequence('ACGT')
    s2 = Sequence('AAAA')
    s1 + s2
    s1+= s2
    "aa" + s1

    try:
        s1 += 2
        assert False
    except:
        assert True

    s1.histogram()
   

    d1 = Sequence('GAGCCTACTAACGGGAT')
    d2 = Sequence('CATCGTAATGACGGCCT')
    #d1 = Sequence(d2)
    assert d1.hamming_distance(d2) == 7
                   
    d1.lower()
    assert d1.sequence == 'gagcctactaacgggat'
    d2.upper()


    d1._check_sequence()

    # __repr__ and __str__
    print d1
    d1.__repr__()
    d1 = Sequence('AAAAa') # length greater than 10
    print d1
    d1.__repr__()


    d1 = Sequence('ACGT')
    dna = DNA('ACGT')
    try:
        d1 += rna
        assert False
    except:
        assert True
    try:
        dna += d1
        assert False
    except:
        assert True


@@ -101,24 +101,36 @@
     s1 + s2%0A
+    s2 + s1%0A
     s1+= s2%0A
@@ -245,16 +245,26 @@
 am()%0A   
+ s1.pie() 
 %0A%0A    d1
@@ -854,28 +854,102 @@
 xcept:%0A        assert True%0A%0A
+%0A    s = Sequence(DNA('ACGT'))%0A    assert s == 'ACGT'%0A    assert s == dna%0A

update test.