human
Complete this python program:
def assertVolumesEqual(test, first, second):
assistant
#Here is the Python program you requested.

    """Assert that two filesystems have the same contents.
    :param TestCase test: A ``TestCase`` that will be the context for this
    operation.
    :param Volume first: First volume.
    :param Volume second: Second volume.
    """
    first = first.get_filesystem().get_path()
    second = second.get_filesystem().get_path()
    def get_contents(path):
        result = {}
        for child in path.children():
            if child.isdir():
                value = get_contents(child)
            else:
                value = child.getContent()
            result[child.basename()] = value
        return result
    test.assertEqual(get_contents(first), get_contents(second))