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

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)

        def convert_statement(statement):
    result = _convert_worklist_statement(statement)
    if result:
        return WORKLIST_STATEMENT, result

    result = _convert_role_inheritance_statement(statement)
    if result:
        return ROLE_INHERITANCE_STATEMENT, result

    result = _convert_permission_statement(statement)
    if result:
        return PERMISSION_STATEMENT, result

    raise ParsingError('Unkown statement format: "%s"' % statement)

src/f/t/ftw.lawgiver-1.2.2/ftw/lawgiver/tests/test_wdl_parser.py   ftw.lawgiver(Download)
from ftw.lawgiver.wdl.parser import PERMISSION_STATEMENT
from ftw.lawgiver.wdl.parser import WORKLIST_STATEMENT
from ftw.lawgiver.wdl.parser import convert_statement
from ftw.testing import MockTestCase
from zope.component import getUtility
    def assert_statement(self, expected_result, text):
        result = convert_statement(text)
            expected_result, result,
            'Wrong result when converting statement:' +
    def test_bad_statement(self):
        with self.assertRaises(ParsingError) as cm:
            convert_statement('This is not a statement.')