mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
Making the switch to v2
This commit is contained in:
parent
8cf4452d48
commit
ce3ef7f4c1
486 changed files with 7948 additions and 9070 deletions
33
v1/tests/TestUtilsStringFunctions.py
Normal file
33
v1/tests/TestUtilsStringFunctions.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import unittest
|
||||
import os
|
||||
import os.path
|
||||
import tempfile
|
||||
import yaml
|
||||
import passlib.hash
|
||||
import string
|
||||
import StringIO
|
||||
import copy
|
||||
|
||||
from nose.plugins.skip import SkipTest
|
||||
|
||||
from ansible.utils import string_functions
|
||||
import ansible.errors
|
||||
import ansible.constants as C
|
||||
import ansible.utils.template as template2
|
||||
|
||||
from ansible import __version__
|
||||
|
||||
import sys
|
||||
reload(sys)
|
||||
sys.setdefaultencoding("utf8")
|
||||
|
||||
class TestUtilsStringFunctions(unittest.TestCase):
|
||||
def test_isprintable(self):
|
||||
self.assertFalse(string_functions.isprintable(chr(7)))
|
||||
self.assertTrue(string_functions.isprintable('hello'))
|
||||
|
||||
def test_count_newlines_from_end(self):
|
||||
self.assertEqual(string_functions.count_newlines_from_end('foo\n\n\n\n'), 4)
|
||||
self.assertEqual(string_functions.count_newlines_from_end('\nfoo'), 0)
|
Loading…
Add table
Add a link
Reference in a new issue