mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
43 lines
944 B
Python
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)
|