rename the project to avoid name collsion on PyPi

This commit is contained in:
Kenneth Giusti 2014-04-30 11:28:28 -04:00
parent a890ba98f2
commit b5ffb57ba7
21 changed files with 96 additions and 96 deletions

View File

@ -1,4 +1,4 @@
# dingus # # pyngus #
A messaging framework built on the QPID Proton engine. It provides a A messaging framework built on the QPID Proton engine. It provides a
callback-based API for message passing. callback-based API for message passing.

View File

@ -1,4 +1,4 @@
# Dingus # # Pyngus #
A callback-based messaging framework built around the QPID Proton A callback-based messaging framework built around the QPID Proton
engine. engine.

View File

@ -24,7 +24,7 @@ import optparse
import sys import sys
import uuid import uuid
import dingus import pyngus
from utils import connect_socket from utils import connect_socket
from utils import get_host_port from utils import get_host_port
from utils import process_connection from utils import process_connection
@ -62,7 +62,7 @@ def main(argv=None):
# create AMQP Container, Connection, and SenderLink # create AMQP Container, Connection, and SenderLink
# #
container = dingus.Container(uuid.uuid4().hex) container = pyngus.Container(uuid.uuid4().hex)
conn_properties = {'hostname': host} conn_properties = {'hostname': host}
if opts.trace: if opts.trace:
conn_properties["x-trace-protocol"] = True conn_properties["x-trace-protocol"] = True
@ -78,7 +78,7 @@ def main(argv=None):
connection.pn_sasl.client() connection.pn_sasl.client()
connection.open() connection.open()
class ReceiveCallback(dingus.ReceiverEventHandler): class ReceiveCallback(pyngus.ReceiverEventHandler):
def __init__(self): def __init__(self):
self.done = False self.done = False
self.message = None self.message = None

View File

@ -34,13 +34,13 @@ import time
import uuid import uuid
from proton import Message from proton import Message
import dingus import pyngus
LOG = logging.getLogger() LOG = logging.getLogger()
LOG.addHandler(logging.StreamHandler()) LOG.addHandler(logging.StreamHandler())
class MyConnection(dingus.ConnectionEventHandler): class MyConnection(pyngus.ConnectionEventHandler):
def __init__(self, name, container, properties): def __init__(self, name, container, properties):
self.name = name self.name = name
@ -95,11 +95,11 @@ class MyConnection(dingus.ConnectionEventHandler):
LOG.debug("select() returned") LOG.debug("select() returned")
if readable: if readable:
dingus.read_socket_input(self.connection, pyngus.read_socket_input(self.connection,
self.socket) self.socket)
self.connection.process(time.time()) self.connection.process(time.time())
if writable: if writable:
dingus.write_socket_output(self.connection, pyngus.write_socket_output(self.connection,
self.socket) self.socket)
def close(self, error=None): def close(self, error=None):
@ -160,8 +160,8 @@ class MyConnection(dingus.ConnectionEventHandler):
LOG.debug("SASL done, result=%s", str(result)) LOG.debug("SASL done, result=%s", str(result))
class MyCaller(dingus.SenderEventHandler, class MyCaller(pyngus.SenderEventHandler,
dingus.ReceiverEventHandler): pyngus.ReceiverEventHandler):
"""Implements state for a single RPC call.""" """Implements state for a single RPC call."""
def __init__(self, method_map, my_connection, def __init__(self, method_map, my_connection,
@ -355,7 +355,7 @@ def main(argv=None):
# create AMQP container, connection, sender and receiver # create AMQP container, connection, sender and receiver
# #
container = dingus.Container(uuid.uuid4().hex) container = pyngus.Container(uuid.uuid4().hex)
conn_properties = {} conn_properties = {}
if opts.trace: if opts.trace:
conn_properties["x-trace-protocol"] = True conn_properties["x-trace-protocol"] = True

View File

@ -43,7 +43,7 @@ import uuid
# hp = hpy() # hp = hpy()
from proton import Message, Condition from proton import Message, Condition
import dingus import pyngus
LOG = logging.getLogger() LOG = logging.getLogger()
LOG.addHandler(logging.StreamHandler()) LOG.addHandler(logging.StreamHandler())
@ -60,8 +60,8 @@ reply_senders = {}
socket_connections = {} # indexed by name socket_connections = {} # indexed by name
class SocketConnection(dingus.ConnectionEventHandler): class SocketConnection(pyngus.ConnectionEventHandler):
"""Associates a dingus Connection with a python network socket""" """Associates a pyngus Connection with a python network socket"""
def __init__(self, name, socket_, container, conn_properties): def __init__(self, name, socket_, container, conn_properties):
self.name = name self.name = name
@ -91,7 +91,7 @@ class SocketConnection(dingus.ConnectionEventHandler):
def process_input(self): def process_input(self):
"""Called when socket is read-ready""" """Called when socket is read-ready"""
try: try:
dingus.read_socket_input(self.connection, self.socket) pyngus.read_socket_input(self.connection, self.socket)
except Exception as e: except Exception as e:
LOG.error("Exception on socket read: %s", str(e)) LOG.error("Exception on socket read: %s", str(e))
# may be redundant if closed cleanly: # may be redundant if closed cleanly:
@ -103,7 +103,7 @@ class SocketConnection(dingus.ConnectionEventHandler):
def send_output(self): def send_output(self):
"""Called when socket is write-ready""" """Called when socket is write-ready"""
try: try:
dingus.write_socket_output(self.connection, pyngus.write_socket_output(self.connection,
self.socket) self.socket)
except Exception as e: except Exception as e:
LOG.error("Exception on socket write: %s", str(e)) LOG.error("Exception on socket write: %s", str(e))
@ -187,7 +187,7 @@ class SocketConnection(dingus.ConnectionEventHandler):
LOG.debug("SASL done callback, result=%s", str(result)) LOG.debug("SASL done callback, result=%s", str(result))
class MySenderLink(dingus.SenderEventHandler): class MySenderLink(pyngus.SenderEventHandler):
"""Link for sending RPC replies.""" """Link for sending RPC replies."""
def __init__(self, ident, connection, link_handle, def __init__(self, ident, connection, link_handle,
source_address, properties=None): source_address, properties=None):
@ -227,7 +227,7 @@ class MySenderLink(dingus.SenderEventHandler):
LOG.debug("message sent callback, status=%s", str(status)) LOG.debug("message sent callback, status=%s", str(status))
class MyReceiverLink(dingus.ReceiverEventHandler): class MyReceiverLink(pyngus.ReceiverEventHandler):
""" """
""" """
def __init__(self, ident, connection, link_handle, target_address, def __init__(self, ident, connection, link_handle, target_address,
@ -353,7 +353,7 @@ def main(argv=None):
# create an AMQP container that will 'provide' the RPC service # create an AMQP container that will 'provide' the RPC service
# #
container = dingus.Container("example RPC service") container = pyngus.Container("example RPC service")
global socket_connections global socket_connections
while True: while True:
@ -366,7 +366,7 @@ def main(argv=None):
writefd = [] writefd = []
readers, writers, timers = container.need_processing() readers, writers, timers = container.need_processing()
# map dingus Connections back to my SocketConnections # map pyngus Connections back to my SocketConnections
for c in readers: for c in readers:
sc = c.user_context sc = c.user_context
assert sc and isinstance(sc, SocketConnection) assert sc and isinstance(sc, SocketConnection)

View File

@ -25,7 +25,7 @@ import sys
import uuid import uuid
from proton import Message from proton import Message
import dingus import pyngus
from utils import connect_socket from utils import connect_socket
from utils import get_host_port from utils import get_host_port
from utils import process_connection from utils import process_connection
@ -67,7 +67,7 @@ def main(argv=None):
# create AMQP Container, Connection, and SenderLink # create AMQP Container, Connection, and SenderLink
# #
container = dingus.Container(uuid.uuid4().hex) container = pyngus.Container(uuid.uuid4().hex)
conn_properties = {'hostname': host} conn_properties = {'hostname': host}
if opts.trace: if opts.trace:
conn_properties["x-trace-protocol"] = True conn_properties["x-trace-protocol"] = True

View File

@ -27,7 +27,7 @@ import time
import uuid import uuid
from proton import Message from proton import Message
import dingus import pyngus
from utils import get_host_port from utils import get_host_port
from utils import server_socket from utils import server_socket
@ -36,8 +36,8 @@ LOG = logging.getLogger()
LOG.addHandler(logging.StreamHandler()) LOG.addHandler(logging.StreamHandler())
class SocketConnection(dingus.ConnectionEventHandler): class SocketConnection(pyngus.ConnectionEventHandler):
"""Associates a dingus Connection with a python network socket""" """Associates a pyngus Connection with a python network socket"""
def __init__(self, container, socket_, name, properties): def __init__(self, container, socket_, name, properties):
"""Create a Connection using socket_.""" """Create a Connection using socket_."""
@ -74,7 +74,7 @@ class SocketConnection(dingus.ConnectionEventHandler):
def process_input(self): def process_input(self):
"""Called when socket is read-ready""" """Called when socket is read-ready"""
try: try:
dingus.read_socket_input(self.connection, self.socket) pyngus.read_socket_input(self.connection, self.socket)
except Exception as e: except Exception as e:
LOG.error("Exception on socket read: %s", str(e)) LOG.error("Exception on socket read: %s", str(e))
# may be redundant if closed cleanly: # may be redundant if closed cleanly:
@ -85,7 +85,7 @@ class SocketConnection(dingus.ConnectionEventHandler):
def send_output(self): def send_output(self):
"""Called when socket is write-ready""" """Called when socket is write-ready"""
try: try:
dingus.write_socket_output(self.connection, pyngus.write_socket_output(self.connection,
self.socket) self.socket)
except Exception as e: except Exception as e:
LOG.error("Exception on socket write: %s", str(e)) LOG.error("Exception on socket write: %s", str(e))
@ -143,7 +143,7 @@ class SocketConnection(dingus.ConnectionEventHandler):
LOG.debug("SASL done callback, result=%s", str(result)) LOG.debug("SASL done callback, result=%s", str(result))
class MySenderLink(dingus.SenderEventHandler): class MySenderLink(pyngus.SenderEventHandler):
"""Send messages until credit runs out.""" """Send messages until credit runs out."""
def __init__(self, socket_conn, handle, src_addr=None): def __init__(self, socket_conn, handle, src_addr=None):
self.socket_conn = socket_conn self.socket_conn = socket_conn
@ -198,7 +198,7 @@ class MySenderLink(dingus.SenderEventHandler):
self.send_message() self.send_message()
class MyReceiverLink(dingus.ReceiverEventHandler): class MyReceiverLink(pyngus.ReceiverEventHandler):
"""Receive messages, and drop them.""" """Receive messages, and drop them."""
def __init__(self, socket_conn, handle, rx_addr=None): def __init__(self, socket_conn, handle, rx_addr=None):
self.socket_conn = socket_conn self.socket_conn = socket_conn
@ -270,7 +270,7 @@ def main(argv=None):
# create an AMQP container that will 'provide' the Server service # create an AMQP container that will 'provide' the Server service
# #
container = dingus.Container("Server") container = pyngus.Container("Server")
socket_connections = set() socket_connections = set()
# Main loop: process I/O and timer events: # Main loop: process I/O and timer events:
@ -278,7 +278,7 @@ def main(argv=None):
while True: while True:
readers, writers, timers = container.need_processing() readers, writers, timers = container.need_processing()
# map dingus Connections back to my SocketConnections: # map pyngus Connections back to my SocketConnections:
readfd = [c.user_context for c in readers] readfd = [c.user_context for c in readers]
writefd = [c.user_context for c in writers] writefd = [c.user_context for c in writers]

View File

@ -24,7 +24,7 @@ import socket
import select import select
import time import time
import dingus import pyngus
def get_host_port(server_address): def get_host_port(server_address):
@ -103,19 +103,19 @@ def process_connection(connection, my_socket):
[], [],
timeout) timeout)
if readable: if readable:
dingus.read_socket_input(connection, my_socket) pyngus.read_socket_input(connection, my_socket)
connection.process(time.time()) connection.process(time.time())
if writable: if writable:
dingus.write_socket_output(connection, my_socket) pyngus.write_socket_output(connection, my_socket)
return True return True
# Map the send callback status to a string # Map the send callback status to a string
SEND_STATUS = { SEND_STATUS = {
dingus.SenderLink.ABORTED: "Aborted", pyngus.SenderLink.ABORTED: "Aborted",
dingus.SenderLink.TIMED_OUT: "Timed-out", pyngus.SenderLink.TIMED_OUT: "Timed-out",
dingus.SenderLink.UNKNOWN: "Unknown", pyngus.SenderLink.UNKNOWN: "Unknown",
dingus.SenderLink.ACCEPTED: "Accepted", pyngus.SenderLink.ACCEPTED: "Accepted",
dingus.SenderLink.REJECTED: "REJECTED", pyngus.SenderLink.REJECTED: "REJECTED",
dingus.SenderLink.RELEASED: "RELEASED", pyngus.SenderLink.RELEASED: "RELEASED",
dingus.SenderLink.MODIFIED: "MODIFIED" pyngus.SenderLink.MODIFIED: "MODIFIED"
} }

View File

@ -16,9 +16,9 @@
# specific language governing permissions and limitations # specific language governing permissions and limitations
# under the License. # under the License.
# #
from dingus.container import Container from pyngus.container import Container
from dingus.connection import Connection, ConnectionEventHandler from pyngus.connection import Connection, ConnectionEventHandler
from dingus.link import ReceiverLink, ReceiverEventHandler from pyngus.link import ReceiverLink, ReceiverEventHandler
from dingus.link import SenderLink, SenderEventHandler from pyngus.link import SenderLink, SenderEventHandler
from dingus.sockets import read_socket_input from pyngus.sockets import read_socket_input
from dingus.sockets import write_socket_output from pyngus.sockets import write_socket_output

View File

@ -26,8 +26,8 @@ import proton
import time import time
import warnings import warnings
from dingus.endpoint import Endpoint from pyngus.endpoint import Endpoint
from dingus.link import _SessionProxy from pyngus.link import _SessionProxy
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -21,7 +21,7 @@ __all__ = [
import heapq import heapq
import logging import logging
from dingus.connection import Connection from pyngus.connection import Connection
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -26,7 +26,7 @@ import collections
import logging import logging
import proton import proton
from dingus.endpoint import Endpoint from pyngus.endpoint import Endpoint
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -264,7 +264,7 @@ class SenderLink(_Link):
def send(self, message, delivery_callback=None, def send(self, message, delivery_callback=None,
handle=None, deadline=None): handle=None, deadline=None):
tag = "dingus-tag-%s" % self._next_tag tag = "pyngus-tag-%s" % self._next_tag
self._next_tag += 1 self._next_tag += 1
send_req = SenderLink._SendRequest(self, tag, message, send_req = SenderLink._SendRequest(self, tag, message,
delivery_callback, handle, delivery_callback, handle,

View File

@ -27,7 +27,7 @@ import errno
import logging import logging
import socket import socket
from dingus.connection import Connection from pyngus.connection import Connection
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -19,11 +19,11 @@
# #
from distutils.core import setup from distutils.core import setup
setup(name="dingus", setup(name="pyngus",
version="0.1.0", version="0.1.0",
author="kgiusti", author="kgiusti",
author_email="kgiusti@apache.org", author_email="kgiusti@apache.org",
packages=["dingus"], packages=["pyngus"],
package_dir={"dingus": "python/dingus"}, package_dir={"pyngus": "python/pyngus"},
description="Callback API implemented over Proton", description="Callback API implemented over Proton",
license="Apache Software License") license="Apache Software License")

View File

@ -11,7 +11,7 @@ To run the tests:
3. That's it! 3. That's it!
The unit tests may be run without tox, but your environment must be The unit tests may be run without tox, but your environment must be
set up so that the dingus module is able to be imported by the test set up so that the pyngus module is able to be imported by the test
scripts. For example, setting the PYTHONPATH environment variable to scripts. For example, setting the PYTHONPATH environment variable to
include the path to the build directory. include the path to the build directory.

View File

@ -25,10 +25,10 @@ import time
import uuid import uuid
from proton import Message from proton import Message
import dingus import pyngus
class PerfConnection(dingus.ConnectionEventHandler): class PerfConnection(pyngus.ConnectionEventHandler):
def __init__(self, name, container, properties): def __init__(self, name, container, properties):
self.name = name self.name = name
self.connection = container.create_connection(name, self, self.connection = container.create_connection(name, self,
@ -90,7 +90,7 @@ class PerfReceiveConnection(PerfConnection):
self._msg_count, self._credit_window) self._msg_count, self._credit_window)
class PerfSender(dingus.SenderEventHandler): class PerfSender(pyngus.SenderEventHandler):
def __init__(self, address, perf_send_conn, def __init__(self, address, perf_send_conn,
msg_count, batch_size): msg_count, batch_size):
self.msg = Message() self.msg = Message()
@ -132,7 +132,7 @@ class PerfSender(dingus.SenderEventHandler):
self._send_msgs() self._send_msgs()
class PerfReceiver(dingus.ReceiverEventHandler): class PerfReceiver(pyngus.ReceiverEventHandler):
def __init__(self, address, handle, perf_receive_conn, def __init__(self, address, handle, perf_receive_conn,
msg_count, credit_window): msg_count, credit_window):
self.msg_count = msg_count self.msg_count = msg_count
@ -204,7 +204,7 @@ def main(argv=None):
opts, extra = parser.parse_args(args=argv) opts, extra = parser.parse_args(args=argv)
container = dingus.Container(uuid.uuid4().hex) container = pyngus.Container(uuid.uuid4().hex)
# sender acts like SSL client # sender acts like SSL client
conn_properties = {'hostname': "test.server.com", conn_properties = {'hostname': "test.server.com",

View File

@ -19,7 +19,7 @@
import time import time
import dingus import pyngus
class Test(object): class Test(object):
@ -94,7 +94,7 @@ def _validate_callback(connection):
assert connection._in_process assert connection._in_process
class ConnCallback(dingus.ConnectionEventHandler): class ConnCallback(pyngus.ConnectionEventHandler):
"""Caches the callback parameters for processing by a test.""" """Caches the callback parameters for processing by a test."""
class RequestArgs(object): class RequestArgs(object):
def __init__(self, handle, name, source, target, props): def __init__(self, handle, name, source, target, props):
@ -166,7 +166,7 @@ class ConnCallback(dingus.ConnectionEventHandler):
self.sasl_done_ct += 1 self.sasl_done_ct += 1
class SenderCallback(dingus.SenderEventHandler): class SenderCallback(pyngus.SenderEventHandler):
def __init__(self): def __init__(self):
self.active_ct = 0 self.active_ct = 0
self.remote_closed_ct = 0 self.remote_closed_ct = 0
@ -210,7 +210,7 @@ class DeliveryCallback(object):
self.count += 1 self.count += 1
class ReceiverCallback(dingus.ReceiverEventHandler): class ReceiverCallback(pyngus.ReceiverEventHandler):
def __init__(self): def __init__(self):
self.active_ct = 0 self.active_ct = 0
self.remote_closed_ct = 0 self.remote_closed_ct = 0

View File

@ -24,15 +24,15 @@ import time
from proton import Condition from proton import Condition
from proton import Message from proton import Message
from proton import SSLUnavailable from proton import SSLUnavailable
import dingus import pyngus
class APITest(common.Test): class APITest(common.Test):
def setup(self): def setup(self):
# logging.getLogger("dingus").setLevel(logging.DEBUG) # logging.getLogger("pyngus").setLevel(logging.DEBUG)
self.container1 = dingus.Container("test-container-1") self.container1 = pyngus.Container("test-container-1")
self.container2 = dingus.Container("test-container-2") self.container2 = pyngus.Container("test-container-2")
def teardown(self): def teardown(self):
if self.container1: if self.container1:
@ -374,7 +374,7 @@ class APITest(common.Test):
c2.open() c2.open()
common.process_connections(c1, c2) common.process_connections(c1, c2)
c1.close_input() c1.close_input()
assert c1.needs_input == dingus.Connection.EOS assert c1.needs_input == pyngus.Connection.EOS
assert cb1.failed_ct == 0 assert cb1.failed_ct == 0
c1.process(time.time()) c1.process(time.time())
assert cb1.failed_ct > 0 assert cb1.failed_ct > 0
@ -389,7 +389,7 @@ class APITest(common.Test):
c2.open() c2.open()
common.process_connections(c1, c2) common.process_connections(c1, c2)
c1.close_output() c1.close_output()
assert c1.has_output == dingus.Connection.EOS assert c1.has_output == pyngus.Connection.EOS
assert cb1.failed_ct == 0 assert cb1.failed_ct == 0
c1.process(time.time()) c1.process(time.time())
assert cb1.failed_ct > 0 assert cb1.failed_ct > 0
@ -528,7 +528,7 @@ class APITest(common.Test):
def _test_reject_receiver_sync(self, pn_condition): def _test_reject_receiver_sync(self, pn_condition):
class recv_reject(dingus.ConnectionEventHandler): class recv_reject(pyngus.ConnectionEventHandler):
def __init__(self, pn_condition): def __init__(self, pn_condition):
self._pn_condition = pn_condition self._pn_condition = pn_condition
@ -703,7 +703,7 @@ class APITest(common.Test):
def _test_reject_sender_sync(self, pn_condition): def _test_reject_sender_sync(self, pn_condition):
class send_reject(dingus.ConnectionEventHandler): class send_reject(pyngus.ConnectionEventHandler):
def __init__(self, pn_condition): def __init__(self, pn_condition):
self._pn_condition = pn_condition self._pn_condition = pn_condition

View File

@ -19,18 +19,18 @@
import common import common
import gc import gc
import dingus import pyngus
class APITest(common.Test): class APITest(common.Test):
def test_create_destroy(self): def test_create_destroy(self):
container = dingus.Container("My-Container") container = pyngus.Container("My-Container")
assert container.name == "My-Container" assert container.name == "My-Container"
container.destroy() container.destroy()
def test_create_connection(self): def test_create_connection(self):
container = dingus.Container("A123") container = pyngus.Container("A123")
container.create_connection("c1") container.create_connection("c1")
container.create_connection("c2") container.create_connection("c2")
c1 = container.get_connection("c1") c1 = container.get_connection("c1")
@ -42,7 +42,7 @@ class APITest(common.Test):
def test_cleanup(self): def test_cleanup(self):
gc.enable() gc.enable()
container = dingus.Container("abc") container = pyngus.Container("abc")
c1 = container.create_connection("c1") c1 = container.create_connection("c1")
c2 = container.create_connection("c2") c2 = container.create_connection("c2")
assert c2 assert c2
@ -62,7 +62,7 @@ class APITest(common.Test):
assert not gc.garbage, "Object leak!" assert not gc.garbage, "Object leak!"
def test_need_processing(self): def test_need_processing(self):
container = dingus.Container("abc") container = pyngus.Container("abc")
c1 = container.create_connection("c1") c1 = container.create_connection("c1")
c2 = container.create_connection("c2") c2 = container.create_connection("c2")
props = {"idle-time-out": 10} props = {"idle-time-out": 10}

View File

@ -24,14 +24,14 @@ from proton import Condition
from proton import Message from proton import Message
from proton import symbol from proton import symbol
import dingus import pyngus
class APITest(common.Test): class APITest(common.Test):
def setup(self, conn1_props=None, conn2_props=None): def setup(self, conn1_props=None, conn2_props=None):
# logging.getLogger("dingus").setLevel(logging.DEBUG) # logging.getLogger("pyngus").setLevel(logging.DEBUG)
self.container1 = dingus.Container("test-container-1") self.container1 = pyngus.Container("test-container-1")
self.conn1_handler = common.ConnCallback() self.conn1_handler = common.ConnCallback()
if conn1_props is None: if conn1_props is None:
# props = {"x-trace-protocol": True} # props = {"x-trace-protocol": True}
@ -41,7 +41,7 @@ class APITest(common.Test):
conn1_props) conn1_props)
self.conn1.open() self.conn1.open()
self.container2 = dingus.Container("test-container-2") self.container2 = pyngus.Container("test-container-2")
self.conn2_handler = common.ConnCallback() self.conn2_handler = common.ConnCallback()
self.conn2 = self.container2.create_connection("conn2", self.conn2 = self.container2.create_connection("conn2",
self.conn2_handler, self.conn2_handler,
@ -142,7 +142,7 @@ class APITest(common.Test):
assert sl_handler.closed_ct assert sl_handler.closed_ct
assert sl_handler.active_ct == 0 assert sl_handler.active_ct == 0
assert cb.count assert cb.count
assert cb.status == dingus.SenderLink.ABORTED assert cb.status == pyngus.SenderLink.ABORTED
def test_receiver_abort(self): def test_receiver_abort(self):
rl_handler = common.ReceiverCallback() rl_handler = common.ReceiverCallback()
@ -316,7 +316,7 @@ class APITest(common.Test):
self.process_connections() self.process_connections()
assert cb.link == sender assert cb.link == sender
assert cb.handle == "my-handle" assert cb.handle == "my-handle"
assert cb.status == dingus.SenderLink.ACCEPTED assert cb.status == pyngus.SenderLink.ACCEPTED
def test_send_released(self): def test_send_released(self):
cb = common.DeliveryCallback() cb = common.DeliveryCallback()
@ -333,7 +333,7 @@ class APITest(common.Test):
self.process_connections() self.process_connections()
assert cb.link == sender assert cb.link == sender
assert cb.handle == "my-handle" assert cb.handle == "my-handle"
assert cb.status == dingus.SenderLink.RELEASED assert cb.status == pyngus.SenderLink.RELEASED
def test_send_rejected(self): def test_send_rejected(self):
cb = common.DeliveryCallback() cb = common.DeliveryCallback()
@ -352,7 +352,7 @@ class APITest(common.Test):
self.process_connections() self.process_connections()
assert cb.link == sender assert cb.link == sender
assert cb.handle == "my-handle" assert cb.handle == "my-handle"
assert cb.status == dingus.SenderLink.REJECTED assert cb.status == pyngus.SenderLink.REJECTED
r_cond = cb.info.get("condition") r_cond = cb.info.get("condition")
assert r_cond and r_cond.name == "itchy" assert r_cond and r_cond.name == "itchy"
@ -372,7 +372,7 @@ class APITest(common.Test):
self.process_connections() self.process_connections()
assert cb.link == sender assert cb.link == sender
assert cb.handle == "my-handle" assert cb.handle == "my-handle"
assert cb.status == dingus.SenderLink.MODIFIED assert cb.status == pyngus.SenderLink.MODIFIED
assert cb.info.get("delivery-failed") is False assert cb.info.get("delivery-failed") is False
assert cb.info.get("undeliverable-here") is True assert cb.info.get("undeliverable-here") is True
info = cb.info.get("message-annotations") info = cb.info.get("message-annotations")
@ -392,7 +392,7 @@ class APITest(common.Test):
assert cb.status is None assert cb.status is None
self.process_connections(timestamp=10) self.process_connections(timestamp=10)
assert sender.pending == 0 assert sender.pending == 0
assert cb.status == dingus.SenderLink.TIMED_OUT assert cb.status == pyngus.SenderLink.TIMED_OUT
def test_send_expired_late_reply(self): def test_send_expired_late_reply(self):
cb = common.DeliveryCallback() cb = common.DeliveryCallback()
@ -411,7 +411,7 @@ class APITest(common.Test):
self.process_connections(timestamp=10) self.process_connections(timestamp=10)
assert rl_handler.message_received_ct == 1 assert rl_handler.message_received_ct == 1
assert sender.pending == 0 assert sender.pending == 0
assert cb.status == dingus.SenderLink.TIMED_OUT assert cb.status == pyngus.SenderLink.TIMED_OUT
# late reply: # late reply:
assert cb.count == 1 assert cb.count == 1
msg2, handle = rl_handler.received_messages[0] msg2, handle = rl_handler.received_messages[0]
@ -440,7 +440,7 @@ class APITest(common.Test):
self.process_connections(timestamp=12) self.process_connections(timestamp=12)
assert sender.pending == 0 assert sender.pending == 0
assert cb.count == 1 assert cb.count == 1
assert cb.status == dingus.SenderLink.TIMED_OUT assert cb.status == pyngus.SenderLink.TIMED_OUT
def test_send_expired_no_callback(self): def test_send_expired_no_callback(self):
sender, receiver = self._setup_receiver_sync() sender, receiver = self._setup_receiver_sync()
@ -510,14 +510,14 @@ class APITest(common.Test):
if self.count == 1: if self.count == 1:
# verify that we can safely close ourself, even if there is # verify that we can safely close ourself, even if there is
# a send that has not completed: # a send that has not completed:
assert status == dingus.SenderLink.ACCEPTED assert status == pyngus.SenderLink.ACCEPTED
cond = Condition("indigestion", "old sushi", cond = Condition("indigestion", "old sushi",
{"smoked eel": "yummy"}) {"smoked eel": "yummy"})
link.close(cond) link.close(cond)
else: else:
# the unsent message is aborted prior # the unsent message is aborted prior
# to invoking closed callback: # to invoking closed callback:
assert status == dingus.SenderLink.ABORTED assert status == pyngus.SenderLink.ABORTED
sl_handler = link.user_context sl_handler = link.user_context
assert sl_handler.closed_ct == 0 assert sl_handler.closed_ct == 0
@ -551,7 +551,7 @@ class APITest(common.Test):
cond = cb.info.get('condition') cond = cb.info.get('condition')
assert cond assert cond
assert cond.name == "indigestion" assert cond.name == "indigestion"
assert cb.status == dingus.SenderLink.ABORTED assert cb.status == pyngus.SenderLink.ABORTED
def test_multi_frame_message(self): def test_multi_frame_message(self):
"""Verify multi-frame message send/receive.""" """Verify multi-frame message send/receive."""
@ -590,7 +590,7 @@ class APITest(common.Test):
receiver1.message_accepted(handle) receiver1.message_accepted(handle)
self.process_connections() self.process_connections()
assert cb.count assert cb.count
assert cb.status == dingus.SenderLink.ACCEPTED assert cb.status == pyngus.SenderLink.ACCEPTED
def test_dynamic_receiver_props(self): def test_dynamic_receiver_props(self):
"""Verify dynamic-node-properties can be requested.""" """Verify dynamic-node-properties can be requested."""