def make_comparison_tests(klass, kwargs1, kwargs2):
    def instance(kwargs):
        if isinstance(kwargs, dict):
            return klass(**kwargs)
        return klass(**kwargs())

    class Tests(TestCase):
        def test_equality(self):
            """
            Instances with the same arguments are equal.
            """
            self.assertTrue(instance(kwargs1) == instance(kwargs1))
            self.assertFalse(instance(kwargs1) == instance(kwargs2))

        def test_notequality(self):
            """
            Instance with different arguments are not equal.
            """
            self.assertTrue(instance(kwargs1) != instance(kwargs2))
            self.assertFalse(instance(kwargs1) != instance(kwargs1))
    Tests.__name__ = klass.__name__ + "ComparisonTests"
    return Tests
Create tests to verify a class provides standard ``==`` and ``!=``
dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/test/istatechange.py/make_comparison_tests