Revision a494a741 kamaki/cli/commands/test_cli.py
b/kamaki/cli/commands/test_cli.py | ||
---|---|---|
121 | 121 |
|
122 | 122 |
l1 = [1, 'string', '3', 'many (2 or 3) numbers and strings combined', 5] |
123 | 123 |
|
124 |
d2 = {'key1a': 'val0a', 'key1b': d1, 'key1c': l1}
|
|
124 |
d2 = {'id': 'val0a', 'key0b': d1, 'title': l1}
|
|
125 | 125 |
|
126 | 126 |
l2 = [d2, l1, d1] |
127 | 127 |
|
... | ... | |
130 | 130 |
' check the effects on total result': l1} |
131 | 131 |
|
132 | 132 |
def main(self): |
133 |
from kamaki.cli.utils import print_dict, print_list |
|
133 |
from kamaki.cli.utils import print_dict, print_list, print_items
|
|
134 | 134 |
print('Test simple dict:\n- - -') |
135 | 135 |
print_dict(self.d1) |
136 | 136 |
print('- - -\n') |
... | ... | |
157 | 157 |
print('- - -\n') |
158 | 158 |
print('\nTest non-trivial enumerated list:\n- - -') |
159 | 159 |
print_list(self.l2, with_enumeration=True) |
160 |
print('- - -\n') |
|
161 |
print('\nTest print_items with id:\n- - -') |
|
162 |
print_items([{'id': '42', 'title': 'lalakis 1', 'content': self.d1}, |
|
163 |
{'id': '142', 'title': 'lalakis 2', 'content': self.d2}]) |
|
164 |
print('- - -') |
|
165 |
print('\nTest print_items with id and enumeration:\n- - -') |
|
166 |
print_items([{'id': '42', 'title': 'lalakis 1', 'content': self.d1}, |
|
167 |
{'id': '142', 'title': 'lalakis 2', 'content': self.d2}], |
|
168 |
with_enumeration=True) |
|
169 |
print('- - -') |
|
170 |
print('\nTest print_items with id, title and redundancy:\n- - -') |
|
171 |
print_items([{'id': '42', 'title': 'lalakis 1', 'content': self.d1}, |
|
172 |
{'id': '142', 'title': 'lalakis 2', 'content': self.d2}], |
|
173 |
title=('id', 'title'), |
|
174 |
with_redundancy=True) |
|
175 |
print('- - -') |
|
176 |
print('\nTest print_items with lists- - -') |
|
177 |
print_items([['i00', 'i01', 'i02'], [self.l2, 'i11', self.d1], 3]) |
|
160 | 178 |
print('- - -') |
Also available in: Unified diff