| 291 | |
| 292 | |
| 293 | def queue_test(db): |
| 294 | queue = Queue(Subspace(('queue_test',)), False) |
| 295 | print 'Clear Queue' |
| 296 | queue.clear(db) |
| 297 | print 'Empty? %s' % queue.empty(db) |
| 298 | print 'Push 10, 8, 6' |
| 299 | queue.push(db, 10) |
| 300 | queue.push(db, 8) |
| 301 | queue.push(db, 6) |
| 302 | print 'Empty? %s' % queue.empty(db) |
| 303 | print 'Pop item: %d' % queue.pop(db) |
| 304 | print 'Next item: %d' % queue.peek(db) |
| 305 | print 'Pop item: %d' % queue.pop(db) |
| 306 | print 'Pop item: %d' % queue.pop(db) |
| 307 | print 'Empty? %s' % queue.empty(db) |
| 308 | print 'Push 5' |
| 309 | queue.push(db, 5) |
| 310 | print 'Clear Queue' |
| 311 | queue.clear(db) |
| 312 | print 'Empty? %s' % queue.empty(db) |
| 313 | |
| 314 | |
| 315 | ###################### |