def test_save_and_load(): graph = CoachingGraph() graph.init_semi_random(100) graph.save_as('save_and_load') graphB = CoachingGraph() graphB.load_from('save_and_load') assert len(graph.users) == len(graphB.users)
def load_test_graphs(folderName): testGraphs = [] dirName = get_test_data_directory(folderName) fileNames = get_files_from_directory_with_suffix(dirName, TEST_GRAPH_SUFFIX) for file in fileNames: fullPath = os.path.join(dirName, file) graph = CoachingGraph() graph.load_from(fullPath) testGraphs.append(graph) return testGraphs