~ubuntuone-control-tower/ubuntuone-client/trunk

« back to all changes in this revision

Viewing changes to tests/platform/sync_menu/test_linux.py

- Fixed failing test (LP: #1061100).

Show diffs side-by-side

added added

removed removed

Lines of Context:
334
334
        self.assertEqual(len(children), 5)
335
335
        data_current.reverse()
336
336
        for item in children[6:]:
337
 
            print repr(item)
338
337
            text = item.property_get(linux.Dbusmenu.MENUITEM_PROP_LABEL)
339
338
            self.assertIn(text, uploading_data)
340
339
            size, written = uploading_data[text]
363
362
        self.status_frontend.uploading_data = data_current
364
363
        self.sync_menu.transfers.update_progress()
365
364
        children = self.sync_menu.transfers.get_children()
366
 
        # The menu should only show 5 current transfers.
367
 
        self.assertEqual(len(children), 5)
368
 
        for i, item in enumerate(children):
 
365
        # The menu should only show 5 current transfers and a separator item.
 
366
        self.assertEqual(len(children), 6)
 
367
        i = 0
 
368
        for item in children:
369
369
            text = item.property_get(linux.Dbusmenu.MENUITEM_PROP_LABEL)
 
370
            if text is None:
 
371
                continue
370
372
            percentage = item.property_get_int(
371
373
                linux.SyncMenu.PROGRESS_MENUITEM_PROP_PERCENT_DONE)
372
374
            name, size, written = expected[i]
 
375
            i += 1
373
376
            percentage_expected = written * 100 / size
374
377
            self.assertEqual(text, name)
375
378
            self.assertEqual(percentage, percentage_expected)