Did I find the right examples for you? yes no

All Samples(94)  |  Call(88)  |  Derive(0)  |  Import(6)

src/e/l/eliot-0.3.0/eliot/__init__.py   eliot(Download)
from ._message import Message
from ._action import startAction, startTask, Action
from ._output import ILogger, Logger, MemoryLogger
from ._validation import Field, MessageType, ActionType
from ._traceback import writeTraceback, writeFailure

src/e/l/eliot-0.3.0/eliot/tests/test_validation.py   eliot(Download)
    )
from .._action import startAction, startTask
from .._output import MemoryLogger
from ..serializers import identity
 
            "myapp:bar", [Field.forTypes("b", [int], "")], [], [], "")
 
        logger = MemoryLogger()
 
        with A(logger, a=1):
        L{MemoryLogger}.
        """
        logger = MemoryLogger()
        msg = self.MESSAGE().bind(key=123)
        msg.write(logger)
        L{ValidationError} in L{MemoryLogger.validate}.
        """
        logger = MemoryLogger()
        msg = self.MESSAGE().bind(key="123")
        msg.write(logger)
        to a L{MemoryLogger}.
        """
        logger = MemoryLogger()
        with self.ACTION(logger, key=123) as action:
            action.addSuccessFields(result="foo")

src/e/l/eliot-0.3.0/eliot/tests/test_testing.py   eliot(Download)
    validateLogging, UnflushedTracebacks, assertHasMessage, assertHasAction,
    )
from .._output import MemoryLogger
from .._action import startAction
from .._message import Message
    def test_fromMessagesCreatesLoggedAction(self):
        """
        L{LoggedAction.fromMessages} returns a L{LoggedAction}.
        """
        logger = MemoryLogger()
        messages of an action and stores them in the result.
        """
        logger = MemoryLogger()
        Message.new(x=1).write(logger)
        with startAction(logger, "test"):
        messages of an action and stores them in the result.
        """
        logger = MemoryLogger()
        try:
            with startAction(logger, "test"):
        is not found.
        """
        logger = MemoryLogger()
        with startAction(logger, "test"):
            pass

src/e/l/eliot-0.3.0/eliot/tests/test_output.py   eliot(Download)
from zope.interface.verify import verifyClass
 
from .._output import (
    MemoryLogger, ILogger, Destinations, Logger, json
    )
    def test_write(self):
        """
        Dictionaries written with L{MemoryLogger.write} are stored on a list.
        """
        logger = MemoryLogger()
        raises a C{TypeError}.
        """
        logger = MemoryLogger()
        logger.write({123: 'b'})
        self.assertRaises(TypeError, logger.validate)
    def test_bytesFieldKeys(self):
        """
        Field keys can be bytes containing utf-8 encoded Unicode.
        """
        logger = MemoryLogger()
    def test_bytesMustBeUTF8(self):
        """
        Field keys can be bytes, but only if they're UTF-8 encoded Unicode.
        """
        logger = MemoryLogger()

src/e/l/eliot-0.3.0/eliot/tests/test_message.py   eliot(Download)
 
from .._message import Message, _defaultAction
from .._output import MemoryLogger
from .._action import Action, startAction
 
        dictionary that is superset of the L{Message} contents.
        """
        logger = MemoryLogger()
        msg = Message.new(key=4)
        msg.write(logger)
        to the logger, with the current time in TAI64N format.
        """
        logger = MemoryLogger()
        msg = Message.new(key=4)
        msg._time = lambda: 1387299889.153187625
        L{Action} to the dictionary written to the logger.
        """
        logger = MemoryLogger()
        action = Action(logger, "unique", "/", "sys:thename")
        msg = Message.new(key=2)
        dictionary written to the logger.
        """
        action = Action(MemoryLogger(), "unique", "/", "sys:thename")
        logger = MemoryLogger()
        msg = Message.new(key=2)

src/e/l/eliot-0.3.0/eliot/tests/test_action.py   eliot(Download)
    Action, _ExecutionContext, currentAction, startTask, startAction,
    )
from .._output import MemoryLogger
from .._validation import ActionType, Field, _ActionSerializers
from ..testing import assertContainsFields
    def test_start(self):
        """
        L{Action._start} logs an C{action_status="started"} message.
        """
        logger = MemoryLogger()
        and name, and a task_uuid taken from the parent L{Action}.
        """
        logger = MemoryLogger()
        action = Action(logger, "unique", "/", "sys:thename")
        logger2 = MemoryLogger()
        child.
        """
        logger = MemoryLogger()
        action = Action(logger, "unique", "/", "sys:thename")
        child1 = action.child(logger, "newsystem:newname")