salt/tests/unit/utils/test_ssdp.py
2018-01-26 10:34:31 +01:00

43 lines
944 B
Python

# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Bo Maryniuk <bo@suse.de>`
'''
from __future__ import absolute_import, print_function, unicode_literals
from tests.support.unit import TestCase, skipIf
from tests.support.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch)
# Import Salt libs
import salt.exceptions
import salt.state
from salt.utils import ssdp
try:
import pytest
except ImportError as err:
pytest = None
@skipIf(NO_MOCK, NO_MOCK_REASON)
@skipIf(pytest is None, 'PyTest is missing')
class SSDPTestCase(TestCase):
'''
TestCase for SSDP-related parts.
'''
@patch('salt.utils.ssdp._json', None)
@patch('salt.utils.ssdp.asyncio', None)
def test_base_n_avail(self):
'''
Test SSDP base class availability method.
:return:
'''
base = ssdp.SSDPBase()
print('*' * 80)
print(base._is_available())
print('*' * 80)