← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~mvo/launchpad/add-cnf-metadata-to-release-file into lp:launchpad

 


Diff comments:

> 
> === modified file 'lib/lp/archivepublisher/tests/test_publisher.py'
> --- lib/lp/archivepublisher/tests/test_publisher.py	2018-04-05 11:32:50 +0000
> +++ lib/lp/archivepublisher/tests/test_publisher.py	2018-04-13 15:19:18 +0000
> @@ -2189,6 +2189,36 @@
>                  self.assertReleaseContentsMatch(
>                      release, os.path.join('main', 'dep11', name), f.read())
>  
> +    def testReleaseFileForCommandNotFound(self):
> +        # Test Release file writing for command-not-found metadata.
> +        publisher = Publisher(
> +            self.logger, self.config, self.disk_pool,
> +            self.ubuntutest.main_archive)
> +
> +        # Put some cnf metadata files in place, and force the publisher
> +        # to republish that suite.
> +        series_path = os.path.join(self.config.distsroot, 'breezy-autotest')
> +        cnf_path = os.path.join(series_path, 'main', 'cnf')
> +        cnf_names = ('Commands-amd64.gz', 'Commands-i386.gz')

Could you make these .xz rather than .gz, so that they serve as a more accurate simulation of production?

> +        os.makedirs(cnf_path)
> +        for name in cnf_names:
> +            with gzip.GzipFile(os.path.join(cnf_path, name), 'wb') as f:
> +                f.write(name)
> +        publisher.markPocketDirty(
> +            self.ubuntutest.getSeries('breezy-autotest'),
> +            PackagePublishingPocket.RELEASE)
> +
> +        publisher.A_publish(False)
> +        publisher.C_doFTPArchive(False)
> +        publisher.D_writeReleaseFiles(False)
> +
> +        # The metadata files are listed correctly in Release.
> +        release = self.parseRelease(os.path.join(series_path, 'Release'))
> +        for name in cnf_names:
> +            with open(os.path.join(cnf_path, name), 'rb') as f:
> +                self.assertReleaseContentsMatch(
> +                    release, os.path.join('main', 'cnf', name), f.read())
> +
>      def testReleaseFileTimestamps(self):
>          # The timestamps of Release and all its core entries match.
>          publisher = Publisher(


-- 
https://code.launchpad.net/~mvo/launchpad/add-cnf-metadata-to-release-file/+merge/343161
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References