Skip to content
Snippets Groups Projects
Commit d4f711a6 authored by nimrod's avatar nimrod
Browse files

- Adding doctest.

parent 321977d0
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,19 @@
def to_yaml(value):
'''
Converts given data structure to YAML form.
Examples:
>>> to_yaml([1,2,3])
'[1, 2, 3]\\n'
>>> to_yaml({'a': 1, 'b': 2})
'{a: 1, b: 2}\\n'
>>> to_yaml({1: {'a': [1,2,3]}})
'1:\\n a: [1, 2, 3]\\n'
>>> to_yaml("abc")
'abc\\n...\\n'
'''
from yaml import safe_dump
return safe_dump(value)
......
......@@ -21,6 +21,7 @@ commands =
check-manifest --ignore tox.ini,tests*
python setup.py check -m -r -s
flake8 .
python -m doctest template/filters.py template/__init__.py
./tests.sh
[testenv:release]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment