Example #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)
Example #2
0
def test_people_excludes_no_mitid():
    peeps = list(people())
    no_email = [x for x in peeps if x['MIT_ID'] is not None]
    assert len(no_email) == len(peeps)
Example #3
0
def test_people_excludes_no_kerberos():
    peeps = list(people())
    no_email = [x for x in peeps if x['KRB_NAME_UPPERCASE'] is not None]
    assert len(no_email) == len(peeps)
Example #4
0
def test_people_excludes_no_lastname():
    peeps = list(people())
    no_email = [x for x in peeps if x['LAST_NAME'] is not None]
    assert len(no_email) == len(peeps)
Example #5
0
def test_people_excludes_no_emails():
    peeps = list(people())
    no_email = [x for x in peeps if x['EMAIL_ADDRESS'] is not None]
    assert len(no_email) == len(peeps)
Example #6
0
def test_people_adds_orcids():
    peeps = list(people())
    assert peeps[0]['ORCID'] == 'http://example.com/1'
Example #7
0
def test_people_generates_people():
    peeps = list(people())
    person = peeps[0]
    assert person['KRB_NAME_UPPERCASE'] == 'FOOBAR'
    person = peeps[1]
    assert person['KRB_NAME_UPPERCASE'] == 'THOR'