Esempio n. 1
0
def main(db, feed_type, out):
    """Generate feeds for Symplectic Elements.

    The data is pulled from a database identified by DB, which should
    be a valid SQLAlchemy database connection string. For oracle use:

    oracle://<username>:<password>@<server>:1521/<sid>

    The feed will be printed to stdout if OUT is not specified.

    FEED_TYPE should be 'people' or 'articles'.
    """
    engine.configure(db)
    if feed_type == 'people':
        with person_feed(out) as f:
            for person in people():
                f(person)
    elif feed_type == 'articles':
        with article_feed(out) as f:
            for article in articles():
                f(article)
Esempio n. 2
0
def test_articles_skips_articles_without_required_fields():
    arts = list(articles())
    assert len(arts) == 1
Esempio n. 3
0
def test_articles_generates_articles():
    arts = list(articles())
    assert 'Yawning Abyss of Chaos' in arts[0]['ARTICLE_TITLE']