def test_notebook_hackathon(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") if is_travis_or_appveyor() == "appveyor": return fix_tkinter_issues_virtualenv() temp = get_temp_folder(__file__, "temp_hackathon_2015") keepnote = ls_notebooks("hackathon_2015") assert len(keepnote) > 0 keepnote = [ _ for _ in keepnote if "database_schemas" not in _ and "process_clean_files" not in _ and "times_series" not in _ and "upload" not in _] def valid_cell(cell): if "%blob" in cell: return False if "blob_service" in cell: return False return True if len(keepnote) > 0: for _ in keepnote: fLOG(_) res = execute_notebooks(temp, keepnote, filter=lambda i, n: True, valid_cell=valid_cell, fLOG=fLOG, clean_function=clean_function_notebook) unittest_raise_exception_notebook(res, fLOG) else: warnings.warn("No notebook was tested for the hackathon 2015")
def test_notebook_hackathon_skip(self): fLOG(__file__, self._testMethodName, OutputPrint=__name__ == "__main__") fix_tkinter_issues_virtualenv() temp = get_temp_folder(__file__, "temp_cheat_sheet") keepnote = ls_notebooks("cheat_sheets") assert len(keepnote) > 0 keepnote = [_ for _ in keepnote if "chsh_files" in _] if len(keepnote) > 0: res = execute_notebooks( temp, keepnote, lambda i, n: "deviner" not in n, fLOG=fLOG, clean_function=clean_function_notebook ) unittest_raise_exception_notebook(res, fLOG) else: raise Exception("no notebook")
def test_notebook_challenge_city_tour(self): fLOG(__file__, self._testMethodName, OutputPrint=__name__ == "__main__") fix_tkinter_issues_virtualenv() temp = get_temp_folder(__file__, "temp_challenge_city_tour") keepnote = ls_notebooks(os.path.join("challenges", "city_tour")) assert len(keepnote) > 0 keepnote = [_ for _ in keepnote] if len(keepnote) > 0: res = execute_notebooks( temp, keepnote, lambda i, n: True, fLOG=fLOG, clean_function=clean_function_notebook ) unittest_raise_exception_notebook(res, fLOG) else: raise Exception("no notebook")
def test_notebook_hackathon(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") fix_tkinter_issues_virtualenv() temp = get_temp_folder(__file__, "temp_cheat_sheet") keepnote = ls_notebooks("cheat_sheets") assert len(keepnote) > 0 keepnote = [_ for _ in keepnote if "chsh_files" not in _] if len(keepnote) > 0: fold = os.path.dirname(keepnote[0]) copy = [os.path.join(fold, "geo_data.zip")] for c in copy: shutil.copy(c, temp) res = execute_notebooks(temp, keepnote, lambda i, n: "deviner" not in n, fLOG=fLOG, clean_function=clean_function_notebook) unittest_raise_exception_notebook(res, fLOG) else: raise Exception("no notebook")