Example #1
0
    def test_update_resources(self):
        (
            updated_resource_ids,
            updated_resource_content_ids,
            updated_resource_total_size,
        ) = get_automatically_updated_resources(self.content_db_path,
                                                self.channel_id)

        self.assertEqual(
            set(updated_resource_ids),
            set(map(lambda x: x["id"],
                    self.upgraded_channel.updated_resources)),
        )
        self.assertEqual(
            set(updated_resource_content_ids),
            set(
                map(lambda x: x["content_id"],
                    self.upgraded_channel.updated_resources)),
        )
        self.assertEqual(
            updated_resource_total_size,
            sum(
                map(
                    lambda x: x["file_size"],
                    self.upgraded_channel.updated_resource_localfiles,
                )),
        )
Example #2
0
    def test_update_resources(self):
        (
            updated_resource_ids,
            updated_resource_content_ids,
            updated_resource_total_size,
        ) = get_automatically_updated_resources(self.content_db_path, self.channel_id)

        self.assertEqual(set(updated_resource_ids), set())
        self.assertEqual(set(updated_resource_content_ids), set())
        self.assertEqual(updated_resource_total_size, 0)