Did I find the right examples for you? yes no

All Samples(23)  |  Call(17)  |  Derive(0)  |  Import(6)

src/e/l/eliot-0.3.0/eliot/_traceback.py   eliot(Download)
from .serializers import identity
from ._util import safeunicode
from ._validation import MessageType, Field
 
 
TRACEBACK_MESSAGE = MessageType(
    "eliot:traceback",
    [Field("system", identity, "The system from which this traceback came."),
     Field("reason", safeunicode, "The exception's value."),
     Field("traceback", safeunicode, "The traceback."),
     Field("reason", safeunicode, "The exception's value."),
     Field("traceback", safeunicode, "The traceback."),
     Field("exception", lambda typ: "%s.%s" % (typ.__module__, typ.__name__),
           "The exception type's FQPN.")],
    "An unexpected exception indicating a bug.")

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

src/e/l/eliot-0.3.0/eliot/tests/test_validation.py   eliot(Download)
from unittest import TestCase
 
from .._validation import (
    Field, MessageType, ActionType, ValidationError,
    _MessageSerializer,
    def test_description(self):
        """
        L{Field.description} stores the passed in description.
        """
        field = Field("path", identity, u"A path!")
    def test_key(self):
        """
        L{Field.key} stores the passed in field key.
        """
        field = Field("path", identity, u"A path!")
            raise MyException()
 
        field = Field("key", serialize, u"")
        self.assertRaises(MyException, field.validate, 123)
 
    def test_noExtraValidator(self):
        """
        L{Field.validate} doesn't break if there is no extra validator.
        """
        field = Field("key", identity, u"")

src/e/l/eliot-0.3.0/eliot/tests/test_output.py   eliot(Download)
    MemoryLogger, ILogger, Destinations, Logger, json
    )
from .._validation import ValidationError, Field, _MessageSerializer
from .._traceback import writeTraceback
from ..testing import assertContainsFields
        serializer = _MessageSerializer(
            [Field.forValue("message_type", "type", u"The type"),
             Field("foo", lambda value: object(), u"The type")])
        logger = MemoryLogger()
        logger.write({"message_type": "type",
        serializer = _MessageSerializer(
            [Field.forValue("message_type", "mymessage", "The type"),
             Field("length", len, "The length")])
        messages = [{"message_type": "mymessage", "length": "abc"},
                    {"message_type": "mymessage", "length": "abcd"}]
        serializer = _MessageSerializer(
            [Field.forValue("message_type", "mymessage", "The type"),
             Field("length", len, "The length")])
        message = {"message_type": "mymessage", "length": "abc"}
        logger = MemoryLogger()
        serializer = _MessageSerializer(
            [Field.forValue("message_type", "mymessage", u"The type"),
             Field("length", len, "The length of a thing"),
             ])
        logger.write({"message_type": "mymessage",

src/e/l/eliot-0.3.0/eliot/tests/test_testing.py   eliot(Download)
from .._action import startAction
from .._message import Message
from .._validation import ActionType, MessageType, ValidationError, Field
from .._traceback import writeTraceback
 

src/e/l/eliot-0.3.0/eliot/tests/test_action.py   eliot(Download)
    )
from .._output import MemoryLogger
from .._validation import ActionType, Field, _ActionSerializers
from ..testing import assertContainsFields
from .. import _action