Writing unit tests code

This is the tests use the unittest module.
I use it for the first time.

# -*- coding: utf-8 -*-

import unittest

class Mytest(unittest.TestCase):
      def testCom(self):
          self.m= 34
          self.assert_(self.m == 34)

      def kake(self,a,b):
          return a*b

      def testKo(self):
          a = 45
          self.m = 45
          noni = self.kake(a,self.m)
          self.assert_(self.m == noni)

if __name__ == '__main__':

It run command line.
function testCom is comparison self.m and number of 34.return result true.

Function kake has two arguments.this function retunrn multiplication.Next function testKo is comparison self.m,noni of kake's return value.If it is equal,this code success.Important thing is to use function assert_. If test is failure it will display error meg like python IDE.

25.3. unittest — Unit testing framework — Python v2.7.2 documentation