Skip to main content

Process executor for tests.

Project description

Maybe you want to be able to start database only when you start your program, or maybe you need just to set up additional processes for your tests, this is where you should consider using mirakuru, to add superpowers to your program, or tests.

Latest PyPI version Number of PyPI downloads Wheel Status Egg Status License

Package status

Tests Coverage Status Requirements Status

About

As developers, we have to work on project that rely on multiple processes to run. We guard ourselves with tests. But sometimes it’s not enough what one process sends, and the other receives. Sometimes there’s need to actually exchange data between processes. Or write selenium tests. Or maybe write a program that takes care of starting databases or other required services itself.

If so, then mirakuru is what you need.

Mirakuru starts your required process, and wait for clear indication, that it’s running. There are three basic executors with predefined conditions:

  • Executor - simply starts

  • OutputExecutor - awaits for specified output to be given by process

  • TCPExecutor - waits for ability to connect through tcp with process

  • HTTPExecutor - waits for successful HEAD request (and tcp before).

from mirakuru import HTTPExecutor
from httplib import HTTPConnection, OK


def test_it_works():
    executor = HTTPExecutor("./server", url="http://localhost:6543/")

    # start and wait for it to run
    executor.start()
    # should be running!
    conn = HTTPConnection("localhost", 6543)
    conn.request('GET', '/')
    assert conn.getresponse().status is OK
    executor.stop()

The server command in this case is just a bash script that sleeps for some time and then launches the builtin SimpleHTTPServer on port 6543.

Author

The project was first developed by Mateusz Lenik as summon_process. Later forked, renamed to mirakuru and tended to by The A Room @ Clearcode.

License

mirakuru is licensed under LGPL license, version 3.

Contributing and reporting bugs

Source code is available at: ClearcodeHQ/mirakuru. Issue tracker is located at GitHub Issues. Projects PyPi page.

When contributing, don’t forget to add your name to AUTHORS.rst file.

0.1.1

  • fixed MANIFEST.in

  • updated packaging options

0.1.0

  • exposed process attribute on Executor

  • exposed port and host on TCPExecutor

  • exposed url on HTTPExecutor

  • simplified package structure

  • simplified executors operating api

  • updated documentation

  • added docblocks for every function

  • applied license headers

  • stripped orchestrators

  • forked off from summon_process

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mirakuru-0.1.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

mirakuru-0.1.1-py2.py3-none-any.whl (12.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mirakuru-0.1.1.tar.gz.

File metadata

  • Download URL: mirakuru-0.1.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mirakuru-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4b10727d50016af656ce4c9713d46d9d5086b22b310ff309608058f7b298519b
MD5 55c6c596f24bb203325110d5eaa374b9
BLAKE2b-256 822983b44f149ee3de575c35788393079fc9ec2e90009f1f4d590d3c7b284818

See more details on using hashes here.

File details

Details for the file mirakuru-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mirakuru-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d803f8e1a475a76973e3b69cba1323f8d22adf0c64605092fd4f078362b090be
MD5 0fe1a646fd6e25f9d8d18bf0c8901e3a
BLAKE2b-256 3d69d3bacaf865bc31339d173302b5023a2da08c31a3002b2ec7c954cd39e04a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page