示例#1
0
def test_DBbuilder_signal():
    conn, cur, mdb_dir = setup_db_dir()

    app = wx.App(False)
    frame = CountingFrame(None, total=len(movies1))

    dbthread = DBbuilder.DBbuilderThread(frame, [item[0] for item in movies1],
            mdb_dir)
    dbthread.start()

    app.MainLoop()
示例#2
0
def test_gui_row_addition():
    conn, cur, mdb_dir = setup_db_dir()

    app = wx.App()
    frame = MyFrame(None, conn, cur, mdb_dir)
    app.SetTopWindow(frame)
    frame.Maximize()
    frame.Show()

    dbthread = DBbuilder.DBbuilderThread(frame, [item[0] for item in movies1],
            mdb_dir)
    dbthread.start()

    app.MainLoop()
示例#3
0
def test_dbbuilder_images():
    conn, cur, mdb_dir = setup_db_dir()

    dbthread = DBbuilder.DBbuilderThread(None, [item[0] for item in movies1],
            mdb_dir)
    dbthread.start()
    dbthread.join()

    for item in movies1:
        if item[2]:
            assert(os.path.exists(os.path.join(mdb_dir, images_folder,
                item[0] + '.jpg')))
        else:
            assert(True)
示例#4
0
def test_get_imdb_data_existence():
    for filename, moviename, _ in movies1:
        res = DBbuilder.get_imdb_data(moviename)
        assert(res is not None)
        print ""
        print filename, '->', res['Title'], res['Year'], res['Genre']
示例#5
0
def test_get_imdb_data_correctness():
    for moviename, data in movies2:
        res = DBbuilder.get_imdb_data(moviename)
        assert((res['Title'], res['Year']) == data)
示例#6
0
def test_name_parser():
    for filename, moviename, _ in movies1:
        assert(DBbuilder.get_movie_name(filename) == moviename)
示例#7
0
def test_get_imdb_data_existence():
    for filename, moviename, _ in movies1:
        res = DBbuilder.get_imdb_data(moviename)
        assert res is not None
        print ""
        print filename, "->", res["Title"], res["Year"], res["Genre"]
示例#8
0
def test_get_imdb_data_correctness():
    for moviename, data in movies2:
        res = DBbuilder.get_imdb_data(moviename)
        assert (res["Title"], res["Year"]) == data