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

All Samples(21)  |  Call(18)  |  Derive(0)  |  Import(3)

src/f/t/ftw.lawgiver-1.2.2/ftw/lawgiver/wdl/parser.py   ftw.lawgiver(Download)
from ftw.lawgiver.exceptions import ParsingError
from ftw.lawgiver.wdl.interfaces import IWorkflowSpecificationParser
from ftw.lawgiver.wdl.specification import Specification
from ftw.lawgiver.wdl.specification import Status
from ftw.lawgiver.wdl.specification import Transition
 
        title, src_status_title, dest_status_title = match.groups()
        return Transition(title=title,
                          src_status_title=src_status_title,
                          dest_status_title=dest_status_title)

src/f/t/ftw.lawgiver-1.2.2/ftw/lawgiver/tests/test_wdl_specificaiton.py   ftw.lawgiver(Download)
from ftw.lawgiver.wdl.specification import Specification
from ftw.lawgiver.wdl.specification import Status
from ftw.lawgiver.wdl.specification import Transition
from ftw.lawgiver.wdl.interfaces import ISpecification
from ftw.lawgiver.wdl.interfaces import IStatus
    def test_string_repr(self):
        private = Status('Private', [])
        public = Status('Public', [])
        obj = Transition('publish', private, public)
        self.assertEquals(unicode(obj),
                          u'<Transition "publish" ["Private" => "Public"]>')
 
    def test_src_status_object_or_title_required(self):
        with self.assertRaises(ValueError) as cm:
            Transition('foo', dest_status_title='Bar')
    def test_dest_status_object_or_title_required(self):
        with self.assertRaises(ValueError) as cm:
            Transition('foo', src_status_title='Bar')
 
        self.assertEquals('dest_status or dest_status_title required.',
                          str(cm.exception))
 
    def test_augmenting_states(self):
        obj = Transition('foo', src_status_title='Bar',

src/f/t/ftw.lawgiver-1.2.2/ftw/lawgiver/tests/test_generator_unit.py   ftw.lawgiver(Download)
from ftw.lawgiver.wdl.specification import Specification
from ftw.lawgiver.wdl.specification import Status
from ftw.lawgiver.wdl.specification import Transition
from ftw.testing import ComponentRegistryLayer
from unittest2 import TestCase
        bar = spec.states['Bar'] = Status('Bar', [])
 
        spec.transitions.append(Transition('b\xc3\xa4rize', foo, bar))
        spec.transitions.append(Transition('f\xc3\xbcize', bar, foo))
        spec.validate()
        bar = spec.states['Bar'] = Status('Bar', [])
 
        spec.transitions.append(Transition('b\xc3\xa4rize', foo, bar))
        spec.transitions.append(Transition('f\xc3\xbcize', bar, foo))
        spec.validate()