Skip to main content

automatically setups a parity-ethereum instance, and destroys it after testing

Project description

About

testing.parity automatically setups a parity instance, and destroys it after testing.

https://travis-ci.org/tristan/testing.parity.svg?branch=master https://coveralls.io/repos/tristan/testing.parity/badge.png?branch=master https://codeclimate.com/github/tristan/testing.parity/badges/gpa.svg
Documentation

https://github.com/tristan/testing.parity

Issues

https://github.com/tristan/testing.parity/issues

Download

https://pypi.python.org/pypi/testing.parity

Install

Use pip:

$ pip install testing.parity

And testing.parity requires parity server in your PATH.

Usage

Create Parity instance using testing.parity.ParityServer:

import testing.parity
import json
import urllib.request

# Lanuch new Parity-Ethereum server
with testing.parity.ParityServer() as parity:
    # test that jsonrpc responds
    result = urllib.request.urlopen(
        urllib.request.Request(
            parity.url(),
            headers={'Content-Type': "application/json"},
            data=json.dumps({
               "jsonrpc": "2.0",
               "id": "1234",
               "method": "eth_blockNumber",
               "params": []
            }).encode('utf-8')
        ))
    print(json.load(result))

# Parity server is terminated here

Requirements

  • Python 2.7, 3.4, 3.5, 3.6

License

Apache License 2.0

History

1.0.1 (2018-08-03)

  • First release

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

testing.parity-1.0.1.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

testing.parity-1.0.1-py2.py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 2 Python 3

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