diff --git a/test/test_sensu_checks.py b/test/test_sensu_checks.py index a57762165b8d46a7e2ba9dd26d591dd4aebdbf41..50e500bc567daecc67031a29e8dcb23046dc2a64 100644 --- a/test/test_sensu_checks.py +++ b/test/test_sensu_checks.py @@ -41,7 +41,7 @@ def test_check_lifecycle(config, mocked_sensu, mocked_inventory): assert check_name not in mocked_sensu -class TestingCheck(sensu.AbstractCheck): +class DummyCheck(sensu.AbstractCheck): def __init__(self, name, command, proxy_entity_name): super().__init__() @@ -63,61 +63,61 @@ class TestingCheck(sensu.AbstractCheck): def test_check_dict_schema(): - c = TestingCheck(name='x', command='y', proxy_entity_name='z') + c = DummyCheck(name='x', command='y', proxy_entity_name='z') jsonschema.validate(c.to_dict(), sensu.AbstractCheck.CHECK_DICT_SCHEMA) def test_check_compare(): - a = TestingCheck(name='x', command='y', proxy_entity_name='z') - b = TestingCheck(name='x', command='y', proxy_entity_name='z') + a = DummyCheck(name='x', command='y', proxy_entity_name='z') + b = DummyCheck(name='x', command='y', proxy_entity_name='z') assert sensu.checks_match(a.to_dict(), b.to_dict()) def test_checks_differ(): - a = TestingCheck(name='x', command='x', proxy_entity_name='1') - b = TestingCheck(name='x', command='x', proxy_entity_name='2') + a = DummyCheck(name='x', command='x', proxy_entity_name='1') + b = DummyCheck(name='x', command='x', proxy_entity_name='2') assert not sensu.checks_match(a.to_dict(), b.to_dict()) - a = TestingCheck(name='x', command='1', proxy_entity_name='x') - b = TestingCheck(name='x', command='2', proxy_entity_name='x') + a = DummyCheck(name='x', command='1', proxy_entity_name='x') + b = DummyCheck(name='x', command='2', proxy_entity_name='x') assert not sensu.checks_match(a.to_dict(), b.to_dict()) - a = TestingCheck(name='1', command='x', proxy_entity_name='x') - b = TestingCheck(name='2', command='x', proxy_entity_name='x') + a = DummyCheck(name='1', command='x', proxy_entity_name='x') + b = DummyCheck(name='2', command='x', proxy_entity_name='x') assert not sensu.checks_match(a.to_dict(), b.to_dict()) - a = TestingCheck(name='x', command='x', proxy_entity_name='x') - b = TestingCheck(name='x', command='x', proxy_entity_name='x') + a = DummyCheck(name='x', command='x', proxy_entity_name='x') + b = DummyCheck(name='x', command='x', proxy_entity_name='x') a.publish = not a.publish assert not sensu.checks_match(a.to_dict(), b.to_dict()) - a = TestingCheck(name='x', command='x', proxy_entity_name='x') - b = TestingCheck(name='x', command='x', proxy_entity_name='x') + a = DummyCheck(name='x', command='x', proxy_entity_name='x') + b = DummyCheck(name='x', command='x', proxy_entity_name='x') a.interval += 1 assert not sensu.checks_match(a.to_dict(), b.to_dict()) - a = TestingCheck(name='x', command='x', proxy_entity_name='x') - b = TestingCheck(name='x', command='x', proxy_entity_name='x') + a = DummyCheck(name='x', command='x', proxy_entity_name='x') + b = DummyCheck(name='x', command='x', proxy_entity_name='x') a.round_robin = not a.round_robin assert not sensu.checks_match(a.to_dict(), b.to_dict()) - a = TestingCheck(name='x', command='x', proxy_entity_name='x') - b = TestingCheck(name='x', command='x', proxy_entity_name='x') + a = DummyCheck(name='x', command='x', proxy_entity_name='x') + b = DummyCheck(name='x', command='x', proxy_entity_name='x') a.output_metric_format = a.output_metric_format + 'x' assert not sensu.checks_match(a.to_dict(), b.to_dict()) - a = TestingCheck(name='x', command='x', proxy_entity_name='x') - b = TestingCheck(name='x', command='x', proxy_entity_name='x') + a = DummyCheck(name='x', command='x', proxy_entity_name='x') + b = DummyCheck(name='x', command='x', proxy_entity_name='x') a.subscriptions.append('x') assert not sensu.checks_match(a.to_dict(), b.to_dict()) - a = TestingCheck(name='x', command='x', proxy_entity_name='x') - b = TestingCheck(name='x', command='x', proxy_entity_name='x') + a = DummyCheck(name='x', command='x', proxy_entity_name='x') + b = DummyCheck(name='x', command='x', proxy_entity_name='x') a.output_metric_handlers.append('x') assert not sensu.checks_match(a.to_dict(), b.to_dict()) - a = TestingCheck(name='x', command='x', proxy_entity_name='x') - b = TestingCheck(name='x', command='x', proxy_entity_name='x') + a = DummyCheck(name='x', command='x', proxy_entity_name='x') + b = DummyCheck(name='x', command='x', proxy_entity_name='x') a.namespace = a.namespace + 'x' assert not sensu.checks_match(a.to_dict(), b.to_dict())