Revision 1d0f1ffa kamaki/cli/commands/livetest.py

b/kamaki/cli/commands/livetest.py
77 77

  
78 78
    @errors.generic.all
79 79
    def _run(self, *args):
80
        print(args)
80
        self.writeln(args)
81 81

  
82 82
    def main(self, *args):
83 83
        self._run(args)
......
163 163
    @errors.generic.all
164 164
    def _run(self):
165 165
        from kamaki.cli.utils import print_dict, print_list, print_items
166
        print('Test simple dict:\n- - -')
166
        self.writeln('Test simple dict:\n- - -')
167 167
        print_dict(self.d1)
168
        print('- - -\n')
169
        print('\nTest simple list:\n- - -')
168
        self.writeln('- - -\n')
169
        self.writeln('\nTest simple list:\n- - -')
170 170
        print_list(self.l1)
171
        print('- - -\n')
172
        print('\nTest 2-level dict:\n- - -')
171
        self.writeln('- - -\n')
172
        self.writeln('\nTest 2-level dict:\n- - -')
173 173
        print_dict(self.d2)
174
        print('- - -\n')
175
        print('\nTest non-trivial list:\n- - -')
174
        self.writeln('- - -\n')
175
        self.writeln('\nTest non-trivial list:\n- - -')
176 176
        print_list(self.l2)
177
        print('- - -')
178
        print('\nTest extreme dict:\n- - -')
177
        self.writeln('- - -')
178
        self.writeln('\nTest extreme dict:\n- - -')
179 179
        print_dict(self.d3)
180
        print('- - -\n')
181
        print('Test simple enumerated dict:\n- - -')
180
        self.writeln('- - -\n')
181
        self.writeln('Test simple enumerated dict:\n- - -')
182 182
        print_dict(self.d1, with_enumeration=True)
183
        print('- - -\n')
184
        print('\nTest simple enumerated list:\n- - -')
183
        self.writeln('- - -\n')
184
        self.writeln('\nTest simple enumerated list:\n- - -')
185 185
        print_list(self.l1, with_enumeration=True)
186
        print('- - -\n')
187
        print('Test non-trivial deep-enumerated dict:\n- - -')
186
        self.writeln('- - -\n')
187
        self.writeln('Test non-trivial deep-enumerated dict:\n- - -')
188 188
        print_dict(self.d2, with_enumeration=True, recursive_enumeration=True)
189
        print('- - -\n')
190
        print('\nTest non-trivial enumerated list:\n- - -')
189
        self.writeln('- - -\n')
190
        self.writeln('\nTest non-trivial enumerated list:\n- - -')
191 191
        print_list(self.l2, with_enumeration=True)
192
        print('- - -\n')
193
        print('\nTest print_items with id:\n- - -')
192
        self.writeln('- - -\n')
193
        self.writeln('\nTest print_items with id:\n- - -')
194 194
        print_items([
195 195
            {'id': '42', 'title': 'lalakis 1', 'content': self.d1},
196 196
            {'id': '142', 'title': 'lalakis 2', 'content': self.d2}])
197
        print('- - -')
198
        print('\nTest print_items with id and enumeration:\n- - -')
197
        self.writeln('- - -')
198
        self.writeln('\nTest print_items with id and enumeration:\n- - -')
199 199
        print_items(
200 200
            [
201 201
                {'id': '42', 'title': 'lalakis 1', 'content': self.d1},
202 202
                {'id': '142', 'title': 'lalakis 2', 'content': self.d2}],
203 203
            with_enumeration=True)
204
        print('- - -')
205
        print('\nTest print_items with id, title and redundancy:\n- - -')
204
        self.writeln('- - -')
205
        self.writeln('\nTest print_items with id, title, redundancy:\n- - -')
206 206
        print_items(
207 207
            [
208 208
                {'id': '42', 'title': 'lalakis 1', 'content': self.d1},
209 209
                {'id': '142', 'title': 'lalakis 2', 'content': self.d2}],
210 210
            title=('id', 'title'),
211 211
            with_redundancy=True)
212
        print('- - -')
213
        print('\nTest print_items with lists- - -')
212
        self.writeln('- - -')
213
        self.writeln('\nTest print_items with lists- - -')
214 214
        print_items([['i00', 'i01', 'i02'], [self.l2, 'i11', self.d1], 3])
215
        print('- - -')
215
        self.writeln('- - -')
216 216

  
217 217
    def main(self):
218 218
        self._run()

Also available in: Unified diff