# Path: schema_salad/utils.py
# def json_dumps(
#     obj,  # type: Any
#     **kwargs  # type: Any
# ):  # type: (...) -> str
#     """Force use of unicode."""
#     return json.dumps(convert_to_dict(obj), **kwargs)


import difflib
import re
from typing import Any
from schema_salad.utils import json_dumps
# Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0




class JsonDiffMatcher:
    """Raise AssertionError with a readable JSON diff when not __eq__().

    Used with assert_called_with() so it's possible for a human to see
    the differences between expected and actual call arguments that
    include non-trivial data structures.
    """

    def __init__(self, expected: Any):
        self.expected = expected

    def __eq__(self, actual: Any) -> bool:
        expected_json = json_dumps(self.expected, sort_keys=True, indent=2)

# Path: schema_salad/utils.py
# def json_dumps(
#     obj,  # type: Any
#     **kwargs  # type: Any
# ):  # type: (...) -> str
#     """Force use of unicode."""
#     return json.dumps(convert_to_dict(obj), **kwargs)


# Path: schema_salad/tests/matcher.py
import difflib
import re
from typing import Any
from schema_salad.utils import json_dumps

# Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0




class JsonDiffMatcher:
    """Raise AssertionError with a readable JSON diff when not __eq__().

    Used with assert_called_with() so it's possible for a human to see
    the differences between expected and actual call arguments that
    include non-trivial data structures.
    """

    def __init__(self, expected: Any):
        self.expected = expected

    def __eq__(self, actual: Any) -> bool:
        expected_json = json_dumps(self.expected, sort_keys=True, indent=2)

        actual_json = json_dumps(actual, sort_keys=True, indent=2)