'``BuildPackage.run`` creates an RPM from the supplied ``source_path``.'

@require_rpm
def test_rpm(self):

    destination_path = FilePath(self.mktemp())
    destination_path.makedirs()
    source_path = FilePath(self.mktemp())
    source_path.makedirs()
    source_path.child('Foo').touch()
    source_path.child('Bar').touch()
    expected_prefix = FilePath('/foo/bar')
    expected_paths = set([expected_prefix.child('Foo'), expected_prefix.child('Bar'), FilePath('/other/file')])
    expected_name = 'FooBar'
    expected_epoch = '3'
    expected_rpm_version = RPMVersion(version='0.3', release='0.dev.1')
    expected_license = 'My    Test    License'
    expected_url = 'https://www.example.com/foo/bar'
    expected_vendor = 'Acme    Corporation'
    expected_maintainer = 'noreply@example.com'
    expected_architecture = 'i386'
    expected_description = 'Explosive    Tennis    Balls'
    expected_dependencies = ['test-dep', 'version-dep    >=    42']
    BuildPackage(package_type=PackageTypes.RPM, destination_path=destination_path, source_paths={source_path: FilePath('/foo/bar'), source_path.child('Foo'): FilePath('/other/file')}, name=expected_name, prefix=FilePath('/'), epoch=expected_epoch, rpm_version=expected_rpm_version, license=expected_license, url=expected_url, vendor=expected_vendor, maintainer=expected_maintainer, architecture=expected_architecture, description=expected_description, category='Applications/System', dependencies=[Dependency(package='test-dep'), Dependency(package='version-dep', compare='>=', version='42')]).run()
    rpms = glob('{}*.rpm'.format(destination_path.child(expected_name).path))
    self.assertEqual(1, len(rpms))
    expected_headers = dict(Name=expected_name, Epoch=expected_epoch, Version=expected_rpm_version.version, Release=expected_rpm_version.release, License=expected_license, URL=expected_url, Vendor=expected_vendor, Packager=expected_maintainer, Architecture=expected_architecture, Group='Applications/System')
    rpm_path = FilePath(rpms[0])
    assert_rpm_requires(self, expected_dependencies, rpm_path)
    assert_rpm_headers(self, expected_headers, rpm_path)
    assert_rpm_content(self, expected_paths, rpm_path)
