Exemple #1
0
    def test_summarize_items(self):
        summary = commands.summarize_items([], False)
        self.assertEqual(summary, u"0 items")

        summary = commands.summarize_items([self.item], False)
        self.assertEqual(summary, u"1 items, F, 4kbps, 10:54, 987.0 B")

        i2 = deepcopy(self.item)
        summary = commands.summarize_items([self.item, i2], False)
        self.assertEqual(summary, u"2 items, F, 4kbps, 21:48, 1.9 KiB")

        i2.format = "G"
        summary = commands.summarize_items([self.item, i2], False)
        self.assertEqual(summary, u"2 items, F 1, G 1, 4kbps, 21:48, 1.9 KiB")

        summary = commands.summarize_items([self.item, i2, i2], False)
        self.assertEqual(summary, u"3 items, G 2, F 1, 4kbps, 32:42, 2.9 KiB")
Exemple #2
0
    def test_summarize_items(self):
        summary = commands.summarize_items([], False)
        self.assertEqual(summary, u"0 items")

        summary = commands.summarize_items([self.item], False)
        self.assertEqual(summary, u"1 items, F, 4kbps, 10:54, 987.0 B")

        i2 = deepcopy(self.item)
        summary = commands.summarize_items([self.item, i2], False)
        self.assertEqual(summary, u"2 items, F, 4kbps, 21:48, 1.9 KiB")

        i2.format = "G"
        summary = commands.summarize_items([self.item, i2], False)
        self.assertEqual(summary, u"2 items, F 1, G 1, 4kbps, 21:48, 1.9 KiB")

        summary = commands.summarize_items([self.item, i2, i2], False)
        self.assertEqual(summary, u"3 items, G 2, F 1, 4kbps, 32:42, 2.9 KiB")
Exemple #3
0
    def test_summarize_item(self):
        summary = commands.summarize_items([], True)
        self.assertEqual(summary, u"")

        summary = commands.summarize_items([self.item], True)
        self.assertEqual(summary, u"F, 4kbps, 10:54, 987.0 B")
Exemple #4
0
    def test_summarize_item(self):
        summary = commands.summarize_items([], True)
        self.assertEqual(summary, u"")

        summary = commands.summarize_items([self.item], True)
        self.assertEqual(summary, u"F, 4kbps, 10:54, 987.0 B")