diff --git a/test/knowledge_collection_tools_test.py b/test/knowledge_collection_tools_test.py index 9ebe289..b3c30b1 100644 --- a/test/knowledge_collection_tools_test.py +++ b/test/knowledge_collection_tools_test.py @@ -512,3 +512,29 @@ def test_creating_new_graphs_error(self): _:c14n4 _:c14n1 .""" assert exc.value.message.strip() == expected_message + + +class TestCalculateMerkleRoot: + def test_calculate_merkle_root_with_example_data(self): + """Test calculate_merkle_root function with real-world example data.""" + quads = [ + ' "468.9 sq mi" .', + ' "New York" .', + ' "8,336,817" .', + ' "New York" .', + " .", + ' "0xaac2a420672a1eb77506c544ff01beed2be58c0ee3576fe037c846f97481cefd" .', + " .", + " .", + " .", + ] + + merkle_root = kc_tools.calculate_merkle_root(quads) + + # Expected merkle root for this dataset + expected_merkle_root = ( + "0x897442f7db61619b9f272c69d787975f169d0624d7f08c216017c3218c8ea5da" + ) + + # Verify the result matches the expected value + assert merkle_root == expected_merkle_root