[test] fix text_to_dict doctest (closes #174440)

authorDavid Douard <david.douard@logilab.fr>
changesetf07a5a5b3f4a
branchdefault
phasepublic
hiddenno
parent revision#ad40b2f7b256 [optik_ext] Merge textutils imports
child revision#62386f95f6a5 [graph] More explicit error message if dot is not found (closes #253516)
files modified by this revision
textutils.py
# HG changeset patch
# User David Douard <david.douard@logilab.fr>
# Date 1409567098 -7200
# Mon Sep 01 12:24:58 2014 +0200
# Node ID f07a5a5b3f4afb0274a201970549c43b6c620a3c
# Parent ad40b2f7b2569860df30dd6bf424245d2b0ad9eb
[test] fix text_to_dict doctest (closes #174440)

diff --git a/textutils.py b/textutils.py
@@ -282,15 +282,18 @@
1  def text_to_dict(text):
2      """parse multilines text containing simple 'key=value' lines and return a
3      dict of {'key': 'value'}. When the same key is encountered multiple time,
4      value is turned into a list containing all values.
5 
6 -    >>> text_to_dict('''multiple=1
7 +    >>> d = text_to_dict('''multiple=1
8      ... multiple= 2
9      ... single =3
10      ... ''')
11 -    {'single': '3', 'multiple': ['1', '2']}
12 +    >>> d['single']
13 +    '3'
14 +    >>> d['multiple']
15 +    ['1', '2']
16 
17      """
18      res = {}
19      if not text:
20          return res