Skip to content

Commit

Permalink
Fixing status beacon tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgreenaway committed Apr 24, 2018
1 parent c87d6ca commit a2a8d78
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/unit/beacons/test_status_beacon.py
Expand Up @@ -44,7 +44,11 @@ def setup_loader_modules(self):
}

def test_empty_config(self, *args, **kwargs):
config = {}
config = []

ret = status.validate(config)
self.assertEqual(ret, (True, 'Valid beacon configuration'))

ret = status.beacon(config)

if sys.platform.startswith('win'):
Expand All @@ -56,21 +60,18 @@ def test_empty_config(self, *args, **kwargs):

def test_deprecated_dict_config(self):
config = {'time': ['all']}
ret = status.beacon(config)
self.assertEqual(ret, (True, 'Valid beacon configuration'))

if sys.platform.startswith('win'):
expected = []
else:
expected = ['time']

self.assertEqual(list(ret[0]['data']), expected)
ret = status.validate(config)
self.assertEqual(ret, (False, 'Configuration for status beacon must be a list.'))

def test_list_config(self):
config = [{'time': ['all']}]
ret = status.beacon(config)

ret = status.validate(config)
self.assertEqual(ret, (True, 'Valid beacon configuration'))

ret = status.beacon(config)

if sys.platform.startswith('win'):
expected = []
else:
Expand Down

0 comments on commit a2a8d78

Please sign in to comment.