'Calling :func:`update_repo` with real dpkg utilities creates a
repository in S3.
The filenames in the repository metadata do not have the build
directory in them.'

@skipUnless(which('dpkg-scanpackages'), 'Tests    require    the    ``dpkg-scanpackages``    command.')
def test_real_dpkg_utils(self):

    source_repo = FilePath(self.mktemp())
    source_repo.createDirectory()
    FilePath(__file__).sibling('apt-repo').copyTo(source_repo)
    repo_uri = ('file://' + source_repo.path)
    aws = FakeAWS(routing_rules={}, s3_buckets={self.target_bucket: {}})
    class RealYum(object, ):
        def get_dispatcher(self):
            return yum_dispatcher
    self.update_repo(aws=aws, yum=RealYum(), package_directory=self.package_directory, target_bucket=self.target_bucket, target_key=self.target_key, source_repo=repo_uri, packages=self.packages, flocker_version='0.3.3.dev7', distribution=Distribution(name='ubuntu', version='14.04'))
    expected_files = {os.path.join(self.target_key, file) for file in ['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', 'Packages.gz', 'Release']}
    files_on_s3 = aws.s3_buckets[self.target_bucket]
    self.assertEqual(expected_files, set(files_on_s3.keys()))
    packages_gz = files_on_s3[os.path.join(self.target_key, 'Packages.gz')]
    with GzipFile(fileobj=StringIO(packages_gz), mode='r') as f:
        packages_metadata = f.read()
    self.assertNotIn(self.package_directory.path, packages_metadata)
