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()
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()
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)
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']
def test_get_imdb_data_correctness(): for moviename, data in movies2: res = DBbuilder.get_imdb_data(moviename) assert((res['Title'], res['Year']) == data)
def test_name_parser(): for filename, moviename, _ in movies1: assert(DBbuilder.get_movie_name(filename) == moviename)
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"]
def test_get_imdb_data_correctness(): for moviename, data in movies2: res = DBbuilder.get_imdb_data(moviename) assert (res["Title"], res["Year"]) == data