diff options
| author | J08nY | 2017-06-03 23:00:48 +0200 |
|---|---|---|
| committer | J08nY | 2017-06-17 19:35:47 +0200 |
| commit | 7abfcbfe1f41b915dd4419ae6be857deb49f04db (patch) | |
| tree | a2c010aa1ea98bcff449728732db96e63318504b /src | |
| parent | 6c58abe8a135bd8f572867c170fed19958ca9a09 (diff) | |
| download | mailman-7abfcbfe1f41b915dd4419ae6be857deb49f04db.tar.gz mailman-7abfcbfe1f41b915dd4419ae6be857deb49f04db.tar.zst mailman-7abfcbfe1f41b915dd4419ae6be857deb49f04db.zip | |
Diffstat (limited to 'src')
| -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 fc75e7a93..0ab66e836 100644 --- a/src/mailman/testing/documentation.py +++ b/src/mailman/testing/documentation.py @@ -107,6 +107,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. @@ -138,6 +145,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)) |
