Example #1
0
def test_no_types_db_exception():
    with pytest.raises(Exception) as e:
        met_config = MetricsConfig(CollecdMock())
        config = CollectdConfig([Helper.url_node()])
        met_config.parse_config(config)

    assert 'Specify TypesDB in collectd.conf' in str(e)
 def default_writer():
     return MetricsWriter(CollecdMock())
 def default_buffer():
     return MetricsBuffer(10, CollecdMock())
 def get_sender(conf, buffer):
     return MetricsSender(conf, buffer, CollecdMock())
 def get_batcher(max_batch_size, interval, met_buffer):
     return MetricsBatcher(max_batch_size, interval, met_buffer, CollecdMock())
 def get_buffer(size):
     return MetricsBuffer(size, CollecdMock())
 def default_config():
     met_config = MetricsConfig(CollecdMock())
     config = CollectdConfig([Helper.url_node(), Helper.types_db_node()])
     met_config.parse_config(config)
     return met_config