Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(10)  |  Derive(0)  |  Import(2)

src/g/r/gruvi-HEAD/tests/test_dbus.py   gruvi(Download)
from gruvi import dbus_ffi, txdbus, compat
from gruvi.protocols import errno
from gruvi.dbus import DBusParser, DBusBase, DBusClient
 
from support import *
    def test_simple(self):
        m = b'l\1\0\1\0\0\0\0\1\0\0\0\0\0\0\0'
        parser = DBusParser()
        parser.feed(m)
        msg = parser.pop_message()
    def test_multiple(self):
        m = b'l\1\0\1\0\0\0\0\1\0\0\0\0\0\0\0' \
            b'l\1\0\1\0\0\0\0\1\0\0\0\0\0\0\0'
        parser = DBusParser()
        parser.feed(m)
    def test_incremental(self):
        m = b'l\1\0\1\0\0\0\0\1\0\0\0\0\0\0\0'
        parser = DBusParser()
        for i in range(len(m)-1):
            parser.feed(m[i:i+1])
    def test_illegal_message(self):
        m = b'l\1\0\2\0\0\0\0\1\0\0\0\0\0\0\0'
        parser = DBusParser()
        nbytes = parser.feed(m)
        self.assertNotEqual(nbytes, len(m))

src/g/r/gruvi-0.9.2/tests/test_dbus.py   gruvi(Download)
from gruvi import dbus_ffi, txdbus, compat
from gruvi.protocols import errno
from gruvi.dbus import DBusParser, DBusBase, DBusClient
 
from support import *
    def test_simple(self):
        m = b'l\1\0\1\0\0\0\0\1\0\0\0\0\0\0\0'
        parser = DBusParser()
        parser.feed(m)
        msg = parser.pop_message()
    def test_multiple(self):
        m = b'l\1\0\1\0\0\0\0\1\0\0\0\0\0\0\0' \
            b'l\1\0\1\0\0\0\0\1\0\0\0\0\0\0\0'
        parser = DBusParser()
        parser.feed(m)
    def test_incremental(self):
        m = b'l\1\0\1\0\0\0\0\1\0\0\0\0\0\0\0'
        parser = DBusParser()
        for i in range(len(m)-1):
            parser.feed(m[i:i+1])
    def test_illegal_message(self):
        m = b'l\1\0\2\0\0\0\0\1\0\0\0\0\0\0\0'
        parser = DBusParser()
        nbytes = parser.feed(m)
        self.assertNotEqual(nbytes, len(m))