title: how to Mock a fuction that call of Stored Procedure (python)
body: <p>I want to test function that call stored procedure. after recherche I found that we can mock (<code>patch</code>) database operations.</p>
  
  <p>I have already tried to patch the connexion with the database. </p>
  
  <p>i want to know how can I <code>patch</code> a call of function <em>funct2</em>( call <code>Stored Procedure</code>) so that I can give its output manually </p>
  
  <p>for ex. the output of Stored procedure is :</p>
  
  <pre><code>data= ({'x': 13, 'y': 'san'})
  </code></pre>
  
  <p>this is how look like  my code</p>
  
  <pre><code>class db()
      def  __init__(host, user,password,dbname)
      def funct2()
  
   class A
      def func1(self):
          data = self.dbObj.funct2()
          # use this data to test something
           ....
  
  dbObj=db(host, user,password, dbname)
  </code></pre>
  
  <p>I do not want to connect to any database during this tests,  want to give this output manually in my function_test(<em>func1</em>)</p>