Exemple #1
0
def test_validate_config(app):
    @app.register_parser('test1')
    def parse_message(message):
        pass

    assert app.parsers
    app.validate_config()
    assert not app.parsers

    app = Comet()

    app.register_parser('test1', parse_message)

    @app.register_router('test1')
    def test_router(*args):
        pass

    app.validate_config()
    assert app.parsers
Exemple #2
0
def test_validate_config(app):
    @app.register_parser('test1')
    class TestParser:
        pass

    assert app.parsers
    app.validate_config()
    assert not app.parsers

    app = Comet()

    app.register_parser('test1', TestParser)

    @app.register_router('test1')
    def test_router(*args):
        pass

    app.validate_config()
    assert app.parsers