Skip to content

Commit

Permalink
Assess Exception not raised
Browse files Browse the repository at this point in the history
  • Loading branch information
David Bouchare committed Oct 24, 2019
1 parent 7d00b11 commit ec6504f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/unit/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
HOST_NAME,
FAKE_PROXY
)
from datadog.util.hostname import CfgNotFound, get_hostname

from tests.util.contextmanagers import EnvVars


Expand Down Expand Up @@ -116,9 +118,15 @@ def test_get_hostname(self, mock_config_path):
initialize()
self.assertEqual(api._host_name, HOST_NAME, api._host_name)

def test_hostname_warning_not_present(self):
try:
get_hostname(hostname_from_config=False)
except CfgNotFound:
pytest.fail("Unexpected CfgNotFound Exception")

def test_errors_suppressed(self):
"""
API `errors` field ApiError supppressed when specified
API `errors` field ApiError suppressed when specified
"""
# Test API, application keys, API host, and some HTTP client options
initialize(api_key=API_KEY, app_key=APP_KEY, api_host=API_HOST)
Expand Down

0 comments on commit ec6504f

Please sign in to comment.