Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
brian-polling-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
brian
brian-polling-manager
Commits
c7c583bb
Commit
c7c583bb
authored
Jun 16, 2021
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
don't use 'Test' in class name in unit test
parent
acdca26d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_sensu_checks.py
+24
-24
24 additions, 24 deletions
test/test_sensu_checks.py
with
24 additions
and
24 deletions
test/test_sensu_checks.py
+
24
−
24
View file @
c7c583bb
...
...
@@ -41,7 +41,7 @@ def test_check_lifecycle(config, mocked_sensu, mocked_inventory):
assert
check_name
not
in
mocked_sensu
class
Testing
Check
(
sensu
.
AbstractCheck
):
class
Dummy
Check
(
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
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
y
'
,
proxy_entity_name
=
'
z
'
)
c
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
y
'
,
proxy_entity_name
=
'
z
'
)
jsonschema
.
validate
(
c
.
to_dict
(),
sensu
.
AbstractCheck
.
CHECK_DICT_SCHEMA
)
def
test_check_compare
():
a
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
y
'
,
proxy_entity_name
=
'
z
'
)
b
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
y
'
,
proxy_entity_name
=
'
z
'
)
a
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
y
'
,
proxy_entity_name
=
'
z
'
)
b
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
y
'
,
proxy_entity_name
=
'
z
'
)
assert
sensu
.
checks_match
(
a
.
to_dict
(),
b
.
to_dict
())
def
test_checks_differ
():
a
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
1
'
)
b
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
2
'
)
a
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
1
'
)
b
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
2
'
)
assert
not
sensu
.
checks_match
(
a
.
to_dict
(),
b
.
to_dict
())
a
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
1
'
,
proxy_entity_name
=
'
x
'
)
b
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
2
'
,
proxy_entity_name
=
'
x
'
)
a
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
1
'
,
proxy_entity_name
=
'
x
'
)
b
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
2
'
,
proxy_entity_name
=
'
x
'
)
assert
not
sensu
.
checks_match
(
a
.
to_dict
(),
b
.
to_dict
())
a
=
Testing
Check
(
name
=
'
1
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Testing
Check
(
name
=
'
2
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
a
=
Dummy
Check
(
name
=
'
1
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Dummy
Check
(
name
=
'
2
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
assert
not
sensu
.
checks_match
(
a
.
to_dict
(),
b
.
to_dict
())
a
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
a
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Dummy
Check
(
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
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
a
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
a
.
interval
+=
1
assert
not
sensu
.
checks_match
(
a
.
to_dict
(),
b
.
to_dict
())
a
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
a
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Dummy
Check
(
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
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
a
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Dummy
Check
(
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
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
a
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
a
.
subscriptions
.
append
(
'
x
'
)
assert
not
sensu
.
checks_match
(
a
.
to_dict
(),
b
.
to_dict
())
a
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
a
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Dummy
Check
(
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
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Testing
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
a
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
b
=
Dummy
Check
(
name
=
'
x
'
,
command
=
'
x
'
,
proxy_entity_name
=
'
x
'
)
a
.
namespace
=
a
.
namespace
+
'
x
'
assert
not
sensu
.
checks_match
(
a
.
to_dict
(),
b
.
to_dict
())
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment