mirror of
https://github.com/MaxenceG2M/prometheus-immich-exporter.git
synced 2025-12-08 23:03:22 +00:00
Unit tests (#23)
* Added unit tests and linting tools for development * Added pre-commit config file * Added lint github action * Add tests and coverage comments to PRs * Set coverage options * Fixed yaml * Fixed permissions * Omit tests in coverage report * Run linting only on PRs
This commit is contained in:
13
tests/metric_test.py
Normal file
13
tests/metric_test.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import unittest
|
||||
|
||||
from qbittorrent_exporter.exporter import Metric, MetricType
|
||||
|
||||
|
||||
class TestMetric(unittest.TestCase):
|
||||
def test_metric_initialization(self):
|
||||
metric = Metric(name="test_metric", value=10)
|
||||
self.assertEqual(metric.name, "test_metric")
|
||||
self.assertEqual(metric.value, 10)
|
||||
self.assertEqual(metric.labels, {})
|
||||
self.assertEqual(metric.help_text, "")
|
||||
self.assertEqual(metric.metric_type, MetricType.GAUGE)
|
||||
Reference in New Issue
Block a user