title: Bespoken Code Coverage for self-hosted Alexa Skill written in Python (Flask)
body: <p>I am working on an Alexa Skill written in Python using the ask-sdk for Python. This skill is running self-hosted on a Flask server listening to port 5000.
  Now i would like to integrate Unit-Tests using the Bespoken Framework.</p>
  <p>My testing.json file looks like this:</p>
  <pre><code>{
  
      &quot;locales&quot;: &quot;de-DE&quot;,
      &quot;interactionModel&quot;: &quot;models/de-DE.json&quot;,
      &quot;trace&quot;: true,
      &quot;jest&quot;: {
          &quot;silent&quot;: true
      },
      &quot;skillURL&quot;: &quot;http://localhost:5000&quot;
  }
  </code></pre>
  <p>i am locally running an http.server on port 9998 to get the report.html.
  The tests passed successfully, but the code coverage is not working correctly. It seems like the files used in this skills are not recognized at all. Instead they are looking up the files slides.js, debugger.js, jquery.js</p>
  <pre><code>-----------------------------------------|----------|----------|
  File                                     |  % Stmts | % Branch | 
  -----------------------------------------|----------|----------|
  All files                                |        0 |        0 | 
   docutils/writers/s5_html/themes/default |        0 |        0 | 
    slides.js                              |        0 |        0 |     ...
   werkzeug/debug/shared                   |        0 |        0 | 
    debugger.js                            |        0 |        0 | 
    jquery.js                              |        0 |        0 |
  -----------------------------------------|----------|----------|
  
  Test Suites: 1 passed, 1 total
  Tests:       11 passed, 11 total
  Snapshots:   0 total
  Time:        9.475s
  </code></pre>
  <p>I followed this guide <a href="https://read.bespoken.io/cli/tutorials/tutorial-flask-ask-python/#getting-started" rel="nofollow noreferrer">https://read.bespoken.io/cli/tutorials/tutorial-flask-ask-python/#getting-started</a>.</p>
  <p>Therefore I looked up the FAQ and got this information from <a href="https://read.bespoken.io/unit-testing/faq/#what-are-continuous-integration-ci-and-automated-unit-testing" rel="nofollow noreferrer">https://read.bespoken.io/unit-testing/faq/#what-are-continuous-integration-ci-and-automated-unit-testing</a>:</p>
  <hr />
  <p><strong>Can I unit-test skills written in programming languages other than Javascript?</strong>
  Yes, you can. It does require having a server running locally on your laptop that our library can call, but otherwise it will &quot;just work&quot;.</p>
  <p>Before the test is run, start the server to receive payloads. It will be listening on something like: http://localhost:9000.</p>
  <p>Set that URL in the skillURL configuration element in the testing.json file. This should be set instead of the handler element - the handler only works with Javascript lambdas/functions.</p>
  <p>After tests are run, shut the server down - we recommend doing this as part of a regular process. It can be added to one of our filters, for example - read about filters here XXX.
  Finally, if you have request signature checking or timestamp filtering being performed on the requests, you will need to disable this.</p>
  <hr />
  <p>This is my app.py:</p>
  <pre><code>
  SB = SkillBuilder()
  app = Flask(__name__)
  
  app.config.setdefault(VERIFY_SIGNATURE_APP_CONFIG, False)
  id = &quot;XXXX&quot;
  skill_obj = SB.create()
  
  
  webservice_handler = WebserviceSkillHandler(skill=skill_obj)
  webservice_handler.verify_signture = False
  
  
  skill_adapter = SkillAdapter(skill=skill_obj, skill_id=id, app=app)
  
  skill_adapter.VERIFY_SIGNATURE_APP_CONFIG = False
  
  skill_adapter.register(app=app, route=&quot;/&quot;)
  
  
  
  if __name__ == '__main__':
  
      if 'ASK_VERIFY_REQUESTS' in os.environ:
          verify = str(os.environ.get('ASK_VERIFY_REQUESTS', '')).lower()
          if verify == 'false':
              app.config['ASK_VERIFY_REQUESTS'] = False
      app.run(host='0.0.0.0', port=5000, debug=True)
  
  </code></pre>
  <p>I am thankful for any idea!</p>