mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
877abb89d0
This moves the remaining 30 functions from salt.utils to new locations.
26 lines
752 B
Python
26 lines
752 B
Python
# -*- coding: utf-8 -*-
|
|
'''
|
|
Tests for salt.utils.data
|
|
'''
|
|
|
|
# Import Python libs
|
|
from __future__ import absolute_import
|
|
import textwrap
|
|
|
|
# Import Salt libs
|
|
import salt.utils.templates
|
|
from tests.support.unit import TestCase, LOREM_IPSUM
|
|
|
|
|
|
class TemplatesTestCase(TestCase):
|
|
|
|
def test_get_context(self):
|
|
expected_context = textwrap.dedent('''\
|
|
---
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eget urna a arcu lacinia sagittis.
|
|
Sed scelerisque, lacus eget malesuada vestibulum, justo diam facilisis tortor, in sodales dolor
|
|
[...]
|
|
---''')
|
|
ret = salt.utils.templates.get_context(LOREM_IPSUM, 1, num_lines=1)
|
|
self.assertEqual(ret, expected_context)
|