Skip to content
Snippets Groups Projects
Commit b5513222 authored by Jan David Mol's avatar Jan David Mol
Browse files

fix

parent eb61ecca
No related branches found
No related tags found
1 merge request!5Draft: Added prometheus metrics
Pipeline #78585 failed
Pipeline: Stingray

#78586

    This commit is part of merge request !5. Comments created here will be created in the context of that merge request.
    ......@@ -8,6 +8,8 @@ from unittest.mock import patch, ANY, create_autospec
    from minio import Minio
    from prometheus_client.registry import REGISTRY
    from lofar_stingray.writer import Block, Storage
    ......@@ -17,6 +19,14 @@ class TestStorage(TestCase):
    def setUp(self):
    self.mock_minio = create_autospec(Minio)
    # Clear all metrics to make sure we don't register the same one twice
    # between tests (the library forbids it).
    #
    # Unfortunately, Metrics draw copies of prometheus_client.registry.REGISTRY,
    # and that does not provide a public interface to query the registered collectors.
    for collector in list(REGISTRY._collector_to_names.keys()):
    REGISTRY.unregister(collector)
    def test_create_bucket_if_not_exists(self):
    """Test if bucket is created if not exists"""
    self.mock_minio.bucket_exists.return_value = False
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment