2018-01-17 15:31:51 +00:00
|
|
|
# -*- 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
|
2018-01-17 15:38:54 +00:00
|
|
|
from salt.utils import ssdp
|
2018-01-17 15:31:51 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
'''
|
|
|
|
|
2018-01-17 15:38:54 +00:00
|
|
|
@patch('salt.utils.ssdp._json', None)
|
|
|
|
@patch('salt.utils.ssdp.asyncio', None)
|
|
|
|
def test_base_n_avail(self):
|
2018-01-17 15:31:51 +00:00
|
|
|
'''
|
2018-01-17 15:38:54 +00:00
|
|
|
Test SSDP base class availability method.
|
2018-01-17 15:31:51 +00:00
|
|
|
:return:
|
|
|
|
'''
|
2018-01-17 15:38:54 +00:00
|
|
|
base = ssdp.SSDPBase()
|
|
|
|
print('*' * 80)
|
|
|
|
print(base._is_available())
|
|
|
|
print('*' * 80)
|