def test_fake_deb(self):
        existing_s3_keys = {
            os.path.join(self.target_key, 'existing_package.deb'): '',
            os.path.join(self.target_key,
                         'clusterhq-flocker-cli_0.3.3-0.dev.7_all.deb'):
                'existing-content-to-be-replaced',  # noqa
            os.path.join(self.target_key, 'Packages.gz'):
                'metadata for: existing_package.deb',
        }
        # Copy before passing to FakeAWS
        expected_keys = existing_s3_keys.copy()

        aws = FakeAWS(
            routing_rules={},
            s3_buckets={
                self.target_bucket: existing_s3_keys,
            },
        )

        unspecified_package = 'unspecified-package_0.3.3-0.dev.7_all.deb'
        repo_contents = {
            'clusterhq-flocker-cli_0.3.3-0.dev.7_all.deb': 'cli-package',
            'clusterhq-flocker-node_0.3.3-0.dev.7_all.deb': 'node-package',
            'clusterhq-flocker-docker-plugin_0.3.3-0.dev.7_all.deb':
            'docker-plugin-package',
            unspecified_package: 'unspecified-package-content',
        }

        self.update_repo(
            aws=aws,
            yum=FakeYum(),
            package_directory=self.package_directory,
            target_bucket=self.target_bucket,
            target_key=self.target_key,
            source_repo=create_fake_repository(self, files=repo_contents),
            packages=self.packages,
            flocker_version='0.3.3.dev7',
            distribution=Distribution(name='ubuntu', version='14.04'),
        )

        # The expected files are the new files plus the package which already
        # existed in S3.
        expected_packages = {
            'existing_package.deb',
            'clusterhq-flocker-cli_0.3.3-0.dev.7_all.deb',
            'clusterhq-flocker-node_0.3.3-0.dev.7_all.deb',
            'clusterhq-flocker-docker-plugin_0.3.3-0.dev.7_all.deb',
        }

        expected_keys.update({
            'test/target/key/Release': 'Origin: ClusterHQ\n',
            'test/target/key/clusterhq-flocker-cli_0.3.3-0.dev.7_all.deb':
                'cli-package',
            'test/target/key/clusterhq-flocker-node_0.3.3-0.dev.7_all.deb':
                'node-package',
            'test/target/key/clusterhq-flocker-docker-plugin_0.3.3-0.dev.7_all.deb':  # noqa
                'docker-plugin-package',
            'test/target/key/Packages.gz':
                'Packages.gz for: ' + ','.join(sorted(expected_packages)),
            })

        self.assertEqual(
            expected_keys,
            aws.s3_buckets[self.target_bucket])
Read Tag info (or header)
dataset/ETHPy150Open ClusterHQ/flocker/admin/test/test_release.py/UpdateRepoTests.test_fake_deb--crossover with--dataset/ETHPy150Open mne-tools/mne-python/mne/io/tag.py/read_tag_info