1

I am creating auto tests for application (with python, that i am not so familiar with).

Simplified logic:

  1. Start application
  2. Start my service
  3. Send request for that application to perform task
  4. Application send to my service http request with some info

I totally have no idea what to use. After small research i found tornado, but it looks like overkill lib for my task.

Can someone recommend that kind of lib for python (with official documentation)

1 Answer 1

1

Python has a web server built-in. Maybe this is all what you need.

On the Command Line,

  • Change to the directory where your interesting files are.
  • run:

python3 -m http.server 8808 --bind 127.0.0.1 > /tmp/simple-web-server.log 2>&1 &

and open your browser here: http://localhost:8808

  • Send your requests to http://localhost:8808 or http://123.45.67.89:8808

(whatever your IP is. Maybe you prefer to use the hostname. YMMV.)

You can use any other port number rather than 8808, but on Linux avoid numbers < 1024 because they are "privileged ports", only assignable by the root user.

If you have only Python 2, run

python -m SimpleHTTPServer 8808 > /tmp/simple-web-server.log 2>&1 &

1
  • 1
    i tryed, but call "serve_forever" block script execution
    – myTalala
    Commented Sep 4, 2019 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.