title: Unittest on AWS Lambda
body: <p>I have a python script that I run on AWS. The script contains the <code>lambda_handler(event, context)</code> function that is called by AWS. Now, I'd like to create a new lambda function that acts as unit test.
  A typical unit test schema is defined as:</p>
  
  <pre><code>import unittest
  
  def my_function(a):
      return a + 1
  
  class Test(unittest.TestCase):
  
      def test_correct(self):
          self.assertEqual( my_function(1), 2)
  
  if __name__ == '__main__':
      unittest.main()
  </code></pre>
  
  <p>In AWS, the <code>lambda_handler(event, context)</code> function is called. How can I make the <code>unittest_lambda_handler(event, context)</code> to perform the unit test?</p>
  
  <p>So I am guessing my code (in the unit test script) should look like:</p>
  
  <pre><code>import main_lambda_function
  import unittest
  
      def unittest_lambda_handler(event, context):
           #what should this function do?
  
      class MyTest(unittest.TestCase):
           def return_type(self,event, context):
              self.assertTrue(isinstance(main_lambda_function.lambda_handler(event, context),int))
  </code></pre>
  
  <p>Is this the correct approach?If so, what should <code>unittest_lambda_handler</code> do?</p>