Python :unit test throws <Response streamed [200 OK]> instead of actual output
<pre><code>from flask import jsonify

@app.route('/urlinfo/1/&lt;path:URL&gt;', methods=['GET']) 
def search(URL): 
  if something:
     a=dict(message="everything is good"
     resp=jsonify(a)
     return resp
  else:
     a=dict(error="problem")
     return jsonify(a)
</code></pre>

<p>I am curling it using </p>

<pre><code> curl  http://127.0.0.1:5000/urlinfo/1/'https://www.youtube.com/'
</code></pre>

<p>and it is returning  desired output in json format. </p>

<p>I wrote a Unittest for it </p>

<pre><code> import unittest

 def test_search_non_malicious_url(self):
    #pass safe URL and test web service does not block it
    new_URL= "183.434.44.44:90"
    expected= {
                  "message": "Everything is good"
             }    
    self.assertEqual("a",search(new_URL))
</code></pre>

<p>Unittest fails because instead of returning string ("message": "Everything is good"), <code>search(new_URL)</code> returns <em>Response streamed [200 OK]</em></p>

<p>How to return output as a dictionary <code>{"message": "Everything is good"}</code>?</p>