Пример #1
0
def test_get_existing_movie():
    create_test_tables()
    db = MySQLDatabase(schema='qmdb_test', env='test')
    movie = db.get_movie(1234)
    assert movie.title == 'The Matrix'
    assert movie.year == 1999
    remove_test_tables(db)
Пример #2
0
def test_get_non_existent_movie():
    create_test_tables()
    db = MySQLDatabase(schema='qmdb_test', env='test')
    with pytest.raises(MovieNotInDatabaseError) as e_info:
        movie = db.get_movie(12345)
    remove_test_tables(db)