krkn_lib.tests.test_krkn_prometheus module

class krkn_lib.tests.test_krkn_prometheus.TestKrknPrometheus(methodName='runTest')

Bases: BaseTest

Integration tests for KrknPrometheus class.

setUp()

Hook method for setting up the test fixture before exercising it.

test_constructor_exception_handling()

Test that constructor exits on initialization failure.

test_constructor_success()

Test successful initialization of KrknPrometheus.

test_constructor_with_bearer_token()

Test initialization with bearer token.

test_parse_metric_missing_label()

Test parse_metric when a label doesn’t exist in the metric.

test_parse_metric_multiple_values()

Test parse_metric with multiple values in the series.

test_parse_metric_no_placeholders()

Test parse_metric with description containing no placeholders.

test_parse_metric_no_value()

Test parse_metric with empty values array.

test_parse_metric_standard_replacement()

Test parse_metric with standard label and value replacement.

test_parse_metric_underscore_label()

Test parse_metric with labels containing underscores.

test_process_alert_critical_severity()

Test process_alert with critical severity level.

test_process_alert_debug_severity()

Test process_alert with debug severity level.

test_process_alert_error_severity()

Test process_alert with error severity level.

test_process_alert_info_severity()

Test process_alert with info severity level.

test_process_alert_invalid_severity()

Test process_alert with invalid severity level.

test_process_alert_missing_description()

Test process_alert with missing description field.

test_process_alert_missing_expr()

Test process_alert with missing expr field.

test_process_alert_missing_severity()

Test process_alert with missing severity field.

test_process_alert_no_records()

Test process_alert when query returns no records.

test_process_alert_warning_severity()

Test process_alert with warning severity level.

test_process_prom_query_in_range_custom_granularity()

Test range query with custom granularity.

test_process_prom_query_in_range_default_times()

Test range query with default start/end times.

test_process_prom_query_in_range_exception()

Test exception handling in range query.

test_process_prom_query_in_range_success()

Test successful range query execution.

test_process_query_exception()

Test exception handling in instant query.

test_process_query_success()

Test successful instant query execution.

url = 'http://localhost:9090'