# -*- coding: utf-8 -*-
'''
    Unit tests for salt.utils.yamldumper
'''

# Import python libs
from __future__ import absolute_import, print_function, unicode_literals

# Import Salt Libs
import salt.utils.yamldumper

# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from tests.support.mock import NO_MOCK, NO_MOCK_REASON


@skipIf(NO_MOCK, NO_MOCK_REASON)
class YamlDumperTestCase(TestCase):
    '''
    TestCase for salt.utils.yamlloader module
    '''
    def test_yaml_dump(self):
        '''
        Test yaml.dump a dict
        '''
        data = {'foo': 'bar'}
        assert salt.utils.yamldumper.dump(data) == '{!!python/unicode \'foo\': !!python/unicode \'bar\'}\n'

        assert salt.utils.yamldumper.dump(data, default_flow_style=False) == '!!python/unicode \'foo\': !!python/unicode \'bar\'\n'

    def test_yaml_safe_dump(self):
        '''
        Test yaml.safe_dump a dict
        '''
        data = {'foo': 'bar'}
        assert salt.utils.yamldumper.safe_dump(data) == '{foo: bar}\n'

        assert salt.utils.yamldumper.safe_dump(data, default_flow_style=False) == 'foo: bar\n'

# -*- coding: utf-8 -*-
'''
    Unit tests for salt.utils.yamldumper
'''

# Import python libs
from __future__ import absolute_import, print_function, unicode_literals

# Import Salt Libs
import salt.utils.yamldumper

# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from tests.support.mock import NO_MOCK, NO_MOCK_REASON


@skipIf(NO_MOCK, NO_MOCK_REASON)
class YamlDumperTestCase(TestCase):
    '''
    TestCase for salt.utils.yamldumper module
    '''
    def test_yaml_dump(self):
        '''
        Test yaml.dump a dict
        '''
        data = {'foo': 'bar'}
        assert salt.utils.yamldumper.dump(data) == '{!!python/unicode \'foo\': !!python/unicode \'bar\'}\n'

        assert salt.utils.yamldumper.dump(data, default_flow_style=False) == '!!python/unicode \'foo\': !!python/unicode \'bar\'\n'

    def test_yaml_safe_dump(self):
        '''
        Test yaml.safe_dump a dict
        '''
        data = {'foo': 'bar'}
        assert salt.utils.yamldumper.safe_dump(data) == '{foo: bar}\n'

        assert salt.utils.yamldumper.safe_dump(data, default_flow_style=False) == 'foo: bar\n'

Update docs for yamldumper test
Update docs for yamldumper test
