def test_check(self):
        """Integration test for supervisord check. Using a mocked supervisord."""
        for tc in self.TEST_CASES:
            check, instances = get_check('supervisord', tc['yaml'])
            self.assertTrue(check is not None, msg=check)
            self.assertEquals(tc['expected_instances'], instances)
            for instance in instances:
                name = instance['name']

                try:
                    # Run the check
                    check.check(instance)
                except Exception, e:
                    if 'error_message' != tc:  # excepted error
                        self.assertEquals(str(e), tc['error_message'])
                    else:
                        self.assertTrue(False, msg=str(e))
                else:
                    # Assert that the check collected the right metrics
                    expected_metrics = tc['expected_metrics'][name]
                    self.assert_metrics(expected_metrics, check.get_metrics())

                    # Assert that the check generated the right service checks
                    expected_service_checks = tc['expected_service_checks'][name]
                    self.assert_service_checks(expected_service_checks,
                                               check.get_service_checks())

    # Unit Tests ###########################################################
dataset/ETHPy150Open serverdensity/sd-agent/tests/checks/mock/test_supervisord.py/TestSupervisordCheck.test_check/operator `in` -> `!=`