From c7c583bb5e5cd28bfc41837804465f798ea40495 Mon Sep 17 00:00:00 2001 From: Erik Reid <erik.reid@geant.org> Date: Wed, 16 Jun 2021 08:55:42 +0200 Subject: [PATCH] don't use 'Test' in class name in unit test --- test/test_sensu_checks.py | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/test/test_sensu_checks.py b/test/test_sensu_checks.py index a577621..50e500b 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()) -- GitLab