示例#1
0
def test_substr():
    courses = []

    c1 = Course('Data Structures and Program Development',
                'CSCI070',
                1)
    c2 = Course('Computability and Logic',
                'CSCI081',
                1)
    courses.append(c1)
    courses.append(c2)

    assert search.substring(courses, 'phys') == []
    assert c1 in search.substring(courses, 'cs70')
    assert c2 in search.substring(courses, 'cs81')
    s = search.substring(courses, 'cs')
    assert c1 in s and c2 in s
示例#2
0
def notes(course):
    global g_courses

    found = search.substring(g_courses, course)

    if found:
        for c in found:
            click.echo('Found notes for ' + str(c))
    else:
        click.echo('Found no courses matching \'' + course + '\'.')