mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
Merge pull request #43731 from twangboy/win_unit_beacons_test_status
Fix `unit.beacons.test_status` for Windows
This commit is contained in:
commit
2581098595
@ -12,6 +12,7 @@
|
||||
|
||||
# Python libs
|
||||
from __future__ import absolute_import
|
||||
import sys
|
||||
|
||||
# Salt libs
|
||||
import salt.config
|
||||
@ -45,14 +46,32 @@ class StatusBeaconTestCase(TestCase, LoaderModuleMockMixin):
|
||||
def test_empty_config(self, *args, **kwargs):
|
||||
config = {}
|
||||
ret = status.beacon(config)
|
||||
self.assertEqual(sorted(list(ret[0]['data'])), sorted(['loadavg', 'meminfo', 'cpustats', 'vmstats', 'time']))
|
||||
|
||||
if sys.platform.startswith('win'):
|
||||
expected = []
|
||||
else:
|
||||
expected = sorted(['loadavg', 'meminfo', 'cpustats', 'vmstats', 'time'])
|
||||
|
||||
self.assertEqual(sorted(list(ret[0]['data'])), expected)
|
||||
|
||||
def test_deprecated_dict_config(self):
|
||||
config = {'time': ['all']}
|
||||
ret = status.beacon(config)
|
||||
self.assertEqual(list(ret[0]['data']), ['time'])
|
||||
|
||||
if sys.platform.startswith('win'):
|
||||
expected = []
|
||||
else:
|
||||
expected = ['time']
|
||||
|
||||
self.assertEqual(list(ret[0]['data']), expected)
|
||||
|
||||
def test_list_config(self):
|
||||
config = [{'time': ['all']}]
|
||||
ret = status.beacon(config)
|
||||
self.assertEqual(list(ret[0]['data']), ['time'])
|
||||
|
||||
if sys.platform.startswith('win'):
|
||||
expected = []
|
||||
else:
|
||||
expected = ['time']
|
||||
|
||||
self.assertEqual(list(ret[0]['data']), expected)
|
||||
|
Loading…
Reference in New Issue
Block a user