This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
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
import tcptest.redis
import tcptest.fluentd

# 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)
    ...

with tcptest.fluentd.Server() as server:
    import fluentd.sender
    import fluentd.event
    fluent.sender.setup('app', port=server.port)
    fluent.event.Event('follow', {'foo': 'bar'})
    fluent.event.Event('label', {'hoge': 'fuga'})
print server.logs
# [('app.follow:', {u'foo': u'bar'}), ('app.label:', {u'hoge': u'fuga'})]

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

TIPS

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
    ...

capture server outputs

import tcptest.redis

res = {}
with tcptest.redis.Server(res=res) as server:
    ...
stdout = res['stdout']
stderr = res['stderr']

redis options

import tcptest.redis

with tcptest.redis.Server(settings=dict(databases=4)) as server:
    ...

redis replication

import tcptest.redis

master = tcptest.redis.Server()
master.start()

slave_settings = {'slaveof': 'localhost %d' % master.port}
slave = tcptest.redis.Server(settings=slave_settings)
slave.start()

CHANGES

0.6.0 - 2015/10/29

  • Support Python3 (thanks ikegami-yukino)
  • Improve redis-server port reserve, to support redis cluster

0.5.0 - 2015/06/12

  • Improve error handling (thanks okamuuu)

0.4.0 - 2014/04/05

  • Support fluentd test server

0.3.0 - 2014/01/28

  • Update tcptest.redis
    • pass command args instead of conf file (require redis-server 2.6 or later)
    • cannot overwrite the server port

0.2.4 - 2013/07/16

  • Fix pip installation
    • Add MANIFEST.in

0.2.1-3 - 2013/05/27

  • Maintain setup.py and docs

0.2.0 - 2013/05/21

  • Support Redis test server

0.1.0 - 2013/05/21

  • First release

Travis

Release History

Release History

0.6.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
tcptest-0.6.0.tar.gz (4.6 kB) Copy SHA256 Checksum SHA256 Source Oct 29, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting