json2graph.tests.test_aux

Auxiliary test functions.

Module Contents

Functions

get_test_list()

Return a list with all JSON files in the test_files folder.

print_graphs_differences(iso_result_graph, ...)

Print three files:

compare_graphs(resulting_graph_path, ...)

Verify if resulting graph corresponds to expected graph.

json2graph.tests.test_aux.get_test_list()

Return a list with all JSON files in the test_files folder.

Returns:

List with complete path of all JSON files in the test_files folder.

Return type:

list[str]

json2graph.tests.test_aux.print_graphs_differences(iso_result_graph, iso_expected_graph, test_name)
Print three files:
  • test*_both.ttl: contains the statements that are present in both the resulting and expected graphs.

  • test*_or.ttl: contains the statements that are present only in the resulting graph.

  • test*_oe.ttl: contains the statements that are present only in the expected graph.

Parameters:
  • iso_result_graph (Graph) – Isomorphic resulting graph.

  • iso_expected_graph (Graph) – Isomorphic expected graph.

  • test_name (str) – Name of the test to be used for printing comparison if evaluation result is negative.

json2graph.tests.test_aux.compare_graphs(resulting_graph_path, expected_graph_path, test_name)

Verify if resulting graph corresponds to expected graph.

Parameters:
  • resulting_graph_path (str) – Path to the generated resulting graph file.

  • expected_graph_path (str) – Path to the expected graph file.

  • test_name (str) – Name of the test to be used for printing comparison if evaluation result is negative.

Returns:

Boolean value indicating if the resulting and expected graphs are equal.

Return type:

bool