Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristineTChen committed Sep 27, 2021
1 parent b735dda commit a9855a5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion amazon_msk/tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
NODE_METRICS_OVERRIDES,
)

from .common import METRICS_FROM_LABELS
from .common import INSTANCE, INSTANCE_LEGACY, METRICS_FROM_LABELS


@pytest.mark.usefixtures('mock_data')
Expand Down Expand Up @@ -179,3 +179,16 @@ def test_custom_metric_path(aggregator, instance_legacy, mock_client):
aggregator.assert_service_check('aws.msk.prometheus.health', c.OK, tags=service_check_tags)

aggregator.assert_all_metrics_covered()

@pytest.mark.parametrize(
'instance',
[
pytest.param(INSTANCE_LEGACY, id='legacy config proxy'),
pytest.param(INSTANCE, id='new config proxy'),
]
)
def test_proxy_config(instance):
HTTP_PROXY = {"http": "example.com"}
init_config = {"proxy": HTTP_PROXY}
c = AmazonMskCheck('amazon_msk', init_config, [instance])
assert c._boto_config.proxies == HTTP_PROXY

0 comments on commit a9855a5

Please sign in to comment.