\begin{Verbatim}[commandchars=\\\{\}]
\PYG{k+kn}{import} \PYG{n+nn}{unittest}
\PYG{k+kn}{from} \PYG{n+nn}{Bio} \PYG{k+kn}{import} \PYG{n}{Biospam}


\PYG{k}{class} \PYG{n+nc}{BiospamTestAddition}\PYG{p}{(}\PYG{n}{unittest}\PYG{o}{.}\PYG{n}{TestCase}\PYG{p}{):}
    \PYG{k}{def} \PYG{n+nf}{test\PYGZus{}addition1}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{):}
        \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}An addition test\PYGZdq{}\PYGZdq{}\PYGZdq{}}
        \PYG{n}{result} \PYG{o}{=} \PYG{n}{Biospam}\PYG{o}{.}\PYG{n}{addition}\PYG{p}{(}\PYG{l+m+mi}{2}\PYG{p}{,} \PYG{l+m+mi}{3}\PYG{p}{)}
        \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{assertEqual}\PYG{p}{(}\PYG{n}{result}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{)}

    \PYG{k}{def} \PYG{n+nf}{test\PYGZus{}addition2}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{):}
        \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}A second addition test\PYGZdq{}\PYGZdq{}\PYGZdq{}}
        \PYG{n}{result} \PYG{o}{=} \PYG{n}{Biospam}\PYG{o}{.}\PYG{n}{addition}\PYG{p}{(}\PYG{l+m+mi}{9}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{)}
        \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{assertEqual}\PYG{p}{(}\PYG{n}{result}\PYG{p}{,} \PYG{l+m+mi}{8}\PYG{p}{)}


\PYG{k}{class} \PYG{n+nc}{BiospamTestDivision}\PYG{p}{(}\PYG{n}{unittest}\PYG{o}{.}\PYG{n}{TestCase}\PYG{p}{):}
    \PYG{k}{def} \PYG{n+nf}{test\PYGZus{}division1}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{):}
        \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}Now let\PYGZsq{}s check division\PYGZdq{}\PYGZdq{}\PYGZdq{}}
        \PYG{n}{result} \PYG{o}{=} \PYG{n}{Biospam}\PYG{o}{.}\PYG{n}{division}\PYG{p}{(}\PYG{l+m+mf}{3.0}\PYG{p}{,} \PYG{l+m+mf}{2.0}\PYG{p}{)}
        \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{assertAlmostEqual}\PYG{p}{(}\PYG{n}{result}\PYG{p}{,} \PYG{l+m+mf}{1.5}\PYG{p}{)}

    \PYG{k}{def} \PYG{n+nf}{test\PYGZus{}division2}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{p}{):}
        \PYG{l+s+sd}{\PYGZdq{}\PYGZdq{}\PYGZdq{}A second division test\PYGZdq{}\PYGZdq{}\PYGZdq{}}
        \PYG{n}{result} \PYG{o}{=} \PYG{n}{Biospam}\PYG{o}{.}\PYG{n}{division}\PYG{p}{(}\PYG{l+m+mf}{10.0}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{2.0}\PYG{p}{)}
        \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{assertAlmostEqual}\PYG{p}{(}\PYG{n}{result}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{5.0}\PYG{p}{)}


\PYG{k}{if} \PYG{n+nv+vm}{\PYGZus{}\PYGZus{}name\PYGZus{}\PYGZus{}} \PYG{o}{==} \PYG{l+s+s2}{\PYGZdq{}\PYGZus{}\PYGZus{}main\PYGZus{}\PYGZus{}\PYGZdq{}}\PYG{p}{:}
    \PYG{n}{runner} \PYG{o}{=} \PYG{n}{unittest}\PYG{o}{.}\PYG{n}{TextTestRunner}\PYG{p}{(}\PYG{n}{verbosity}\PYG{o}{=}\PYG{l+m+mi}{2}\PYG{p}{)}
    \PYG{n}{unittest}\PYG{o}{.}\PYG{n}{main}\PYG{p}{(}\PYG{n}{testRunner}\PYG{o}{=}\PYG{n}{runner}\PYG{p}{)}
\end{Verbatim}
