#10 - Creating auxiliary client class to generate configuration class (#78)

* #10 - Creating auxiliary client class to generate configuration class based on cachet's component list.

* Updating the python version in codacy to reduce false positives

* Moving some of the cachet operations to the client class to clean up the configuration class and making better constants

* Refactoring status to have proper classes and adding more tests. Refactoring the requests tests to use requests-mock.

* Removing unused imports from test_scheduler

* Adding more tests and the ability to run the client from command line

* Updating README and client arg parsing

* Fixing broken unit tests
This commit is contained in:
mtakaki
2020-01-18 13:55:07 -08:00
committed by GitHub
parent bcafbd64f7
commit 5be0217c00
13 changed files with 530 additions and 269 deletions

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env python
class ComponentNonexistentError(Exception):
"""Exception raised when the component does not exist."""
def __init__(self, component_id):
self.component_id = component_id
def __str__(self):
return repr(f'Component with id [{self.component_id}] does not exist.')
class MetricNonexistentError(Exception):
"""Exception raised when the component does not exist."""
def __init__(self, metric_id):
self.metric_id = metric_id
def __str__(self):
return repr(f'Metric with id [{self.metric_id}] does not exist.')