diff options
| author | J08nY | 2017-08-07 18:36:22 +0200 |
|---|---|---|
| committer | J08nY | 2017-08-07 18:36:22 +0200 |
| commit | d107fd41f03b57f7731b60bb7ba921febc3ce3b9 (patch) | |
| tree | cda2a8b12804345da87c043cfa90f6bb59bd83b3 /src/mailman/testing/documentation.py | |
| parent | 9421a6ad9c3d272fd16ece2c21d317ab48251dae (diff) | |
| parent | 8addebbf9802e911c06f6a27b7ffff1e0f1d2e57 (diff) | |
| download | mailman-d107fd41f03b57f7731b60bb7ba921febc3ce3b9.tar.gz mailman-d107fd41f03b57f7731b60bb7ba921febc3ce3b9.tar.zst mailman-d107fd41f03b57f7731b60bb7ba921febc3ce3b9.zip | |
Diffstat (limited to 'src/mailman/testing/documentation.py')
| -rw-r--r-- | src/mailman/testing/documentation.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mailman/testing/documentation.py b/src/mailman/testing/documentation.py index d460be89f..421a272f4 100644 --- a/src/mailman/testing/documentation.py +++ b/src/mailman/testing/documentation.py @@ -109,6 +109,13 @@ def call_http(url, data=None, method=None, username=None, password=None): return content +def _print_dict(data, depth=0): + for item, value in sorted(data.items()): + if isinstance(value, dict): + _print_dict(value, depth+1) + print(' '*depth + '{}: {}'.format(item, value)) + + def dump_json(url, data=None, method=None, username=None, password=None): """Print the JSON dictionary read from a URL. @@ -140,6 +147,9 @@ def dump_json(url, data=None, method=None, username=None, password=None): printable_value = COMMASPACE.join( "'{}'".format(s) for s in sorted(value)) print('{}: [{}]'.format(key, printable_value)) + elif isinstance(value, dict): + print('{}:'.format(key)) + _print_dict(value, 1) else: print('{}: {}'.format(key, value)) |
