Skip to content

Commit

Permalink
Add Cisco_aci service check to minimal e2e test (#10807)
Browse files Browse the repository at this point in the history
* added cisco_aci service check to minimal e2e test

* styling
  • Loading branch information
steveny91 authored Dec 7, 2021
1 parent 6a456b3 commit 41be2b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 10 additions & 1 deletion cisco_aci/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from copy import deepcopy

import pytest

INSTANCE = {'aci_url': 'http://localhost', 'username': 'admin', 'pwd': 'admin'}


@pytest.fixture(scope="session")
def dd_environment():
yield {'aci_urls': []}
yield deepcopy(INSTANCE)


@pytest.fixture
def instance():
return deepcopy(INSTANCE)
6 changes: 4 additions & 2 deletions cisco_aci/tests/test_cisco.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest
from mock import MagicMock

from datadog_checks.base import AgentCheck
from datadog_checks.base.utils.containers import hash_mutable
from datadog_checks.cisco_aci import CiscoACICheck
from datadog_checks.cisco_aci.api import Api, SessionWrapper
Expand Down Expand Up @@ -96,6 +97,7 @@ def test_config(aggregator, extra_config, expected_http_kwargs):


@pytest.mark.e2e
def test_e2e(dd_agent_check, dd_environment):
def test_e2e(dd_agent_check, aggregator, instance):
with pytest.raises(Exception):
dd_agent_check(dd_environment)
dd_agent_check(instance)
aggregator.assert_service_check("cisco_aci.can_connect", AgentCheck.CRITICAL)

0 comments on commit 41be2b4

Please sign in to comment.