

def test_10():
    channel = ('test_10-' + str(time.time()))
    message = '100'

    def _cb(resp, ch=None):
        assert (resp == message)
        pubnub_enc.unsubscribe(channel)

    def _connect(resp):

        def _cb1(resp, ch=None):
            assert (resp[0] == 1)

        def _err1(resp):
            assert False
        pubnub_enc.publish(channel, message, callback=_cb1, error=_err1)

    def _error(resp):
        assert False
    pubnub_enc.subscribe(channel, callback=_cb, connect=_connect, error=_error)

dataset/ETHPy150Open pubnub/python/python-twisted/tests/test_publish_async.py test_10/original