from typing import Tuple


def intersectCmp(a: dict, b: dict) -> Tuple[bool, str]:
    """Return true if the common keys have the same values.

    E.g.: Taking {"foo": 0, "bla": "test"} and
        {"foo": 1, "bar": true, "bla": "test"}, the intersected keys are
        "foo" and "bla", and the values are not equal.

    If there are no common keys, returns False.

    The same comparison applies to nested dictionaries

    Args:
        a, b: Dictionaries to intersect and compare.

    Returns:
        A tuple with the comparison result and a diff text, if different.
    """
    common_keys = a.keys() & b.keys()
    if not common_keys:
        return False, "got %s, wanted %s" % (a.keys(), b.keys())
    for k in common_keys:
        x = a[k]
        y = b[k]
        if isinstance(x, dict) and isinstance(y, dict):
            cmp, diff = intersectCmp(x, y)
            if not cmp:
                return False, diff
        else:
            if x != y:
                return False, "key %s: %s != %s" % (k, x, y)
    return True, ""