1
0

test_pepa.py 745 B

1234567891011121314151617181920212223242526272829
  1. # -*- coding: utf-8 -*-
  2. # Import python libs
  3. from __future__ import absolute_import, print_function, unicode_literals
  4. from collections import OrderedDict
  5. # Import Salt Testing libs
  6. from tests.support.unit import TestCase
  7. # Import Salt Libs
  8. import salt.pillar.pepa as pepa
  9. class PepaPillarTestCase(TestCase):
  10. def test_repeated_keys(self):
  11. expected_result = {
  12. "foo": {
  13. "bar": {
  14. "foo": True,
  15. "baz": True,
  16. },
  17. },
  18. }
  19. data = OrderedDict([
  20. ('foo..bar..foo', True),
  21. ('foo..bar..baz', True),
  22. ])
  23. result = pepa.key_value_to_tree(data)
  24. self.assertDictEqual(result, expected_result)