Skip to main content

Testing TCP program, following the Perl's Test::TCP include memcached and redis test server.

Project description

tcptest is following Perl’s “Test::TCP”.

It has the methods like original one, but also has another TestServer implementation.

This package also includes memcached and redis test server support.

SYNOPSIS

import tcptest.memcached

# with context
with tcptest.memcached.Server() as server:
    memd = memcache.Client(['127.0.0.1:%d' % server.port])
    ...

with tcptest.redis.Server() as server:
    db = redis.Redis(host='127.0.0.1', port=server.port, db=0)
    ...

# manually handling
server = tcptest.memcached.Server()
server.start()
...
server.stop()

# custom server
import tcptest

class YourTestServer(tcptest.TestServer):
    def build_command(self):
        return ('your server command', 'arg1', 'arg2', ...)

with YourTestServer() as server:
    # your server works on server.port
    ...

SEE ALSO

Travis

https://travis-ci.org/nekoya/python-tcptest.png?branch=master

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

tcptest-0.2.2.tar.gz (3.1 kB view hashes)

Uploaded Source

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