def test_index_pattern_use_prefix(self): index = check_elasticsearch_metrics.build_indices(indices_count=1, index_pattern="pattern-{prefix}", index_prefix="xxx") index.should.be.equal("pattern-xxx")
def test_index_pattern_constant(self): index = check_elasticsearch_metrics.build_indices(indices_count=1, index_pattern="const", index_prefix="xxx") index.should.be.equal("const")
def test_indices_count_gt_1(self): index = check_elasticsearch_metrics.build_indices(indices_count=2) index.should.be.equal("logstash-2018.01.15,logstash-2018.01.14") index = check_elasticsearch_metrics.build_indices(indices_count=3) index.should.be.equal("logstash-2018.01.15,logstash-2018.01.14,logstash-2018.01.13")
def test_indices_count_eq_1(self): index = check_elasticsearch_metrics.build_indices(indices_count=1) index.should.be.equal("logstash-2018.01.15")
def test_defaults(self, mock_datetime): index = check_elasticsearch_metrics.build_indices() index.should.be.equal("logstash-2018.01.15,logstash-2018.01.14")
def test_base_case_positive(self, mock_datetime): index = check_elasticsearch_metrics.build_indices(indices_count=2, index_pattern="{prefix}-{yyyy}.{mm}.{dd}", index_prefix="logstash") index.should.be.equal("logstash-2018.01.15,logstash-2018.01.14")