[test] fix text_to_dict doctest (closes #174440)

authorDavid Douard <david.douard@logilab.fr>
changeset68d4551aee67
branchdefault
phasedraft
hiddenyes
parent revision#46c9a34c5af7 [optik_ext] Merge textutils imports
child revision#3ff9bfb473eb [graph] More explicit error message if dot is not found/executable (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 68d4551aee6724ca49384da8a714051b6c211576
# Parent 46c9a34c5af79ae1b0ee0f5537acc77e7b15ba0f
[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