mirror of
https://github.com/mtan93/cachet-url-monitor.git
synced 2026-03-07 21:21:58 +00:00
* #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
20 lines
586 B
Python
20 lines
586 B
Python
#!/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.')
|