Skip to content
Snippets Groups Projects
Commit c7c583bb authored by Erik Reid's avatar Erik Reid
Browse files

don't use 'Test' in class name in unit test

parent acdca26d
Branches
Tags
No related merge requests found
......@@ -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())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment