예제 #1
0
 def do_get_dependencies(self):
     return dict(
         build=model.Build(nvr=u'TurboGears-1.0.8-3.fc11',
                           package=model.Package(**TestPackage.attrs),
                           release=model.Release(**TestRelease.attrs)),
         submitter=model.User(name=u'lmacken'),
     )
예제 #2
0
 def do_get_dependencies(self):
     release = model.Release(**TestRelease.attrs)
     return dict(builds=[
         model.Build(nvr=u'TurboGears-1.0.8-3.fc11',
                     package=model.Package(**TestPackage.attrs),
                     release=release)
     ],
                 bugs=[model.Bug(bug_id=1),
                       model.Bug(bug_id=2)],
                 cves=[model.CVE(cve_id=u'CVE-2009-0001')],
                 release=release,
                 user=model.User(name=u'lmacken'))
예제 #3
0
    def test_assign_alias(self):
        update = self.obj
        with mock.patch(target='uuid.uuid4', return_value='wat'):
            update.assign_alias()
        year = time.localtime()[0]
        idx = 'a3bbe1a8f2'
        eq_(update.alias, u'%s-%s-%s' % (update.release.id_prefix, year, idx))

        update = self.get_update(name=u'TurboGears-0.4.4-8.fc11')
        with mock.patch(target='uuid.uuid4', return_value='wat2'):
            update.assign_alias()
        idx = '016462d41f'
        eq_(update.alias, u'%s-%s-%s' % (update.release.id_prefix, year, idx))

        ## Create another update for another release that has the same
        ## Release.id_prefix.  This used to trigger a bug that would cause
        ## duplicate IDs across Fedora 10/11 updates.
        update = self.get_update(name=u'nethack-3.4.5-1.fc10')
        otherrel = model.Release(
            name=u'fc10',
            long_name=u'Fedora 10',
            id_prefix=u'FEDORA',
            dist_tag=u'dist-fc10',
            stable_tag=u'dist-fc10-updates',
            testing_tag=u'dist-fc10-updates-testing',
            candidate_tag=u'dist-fc10-updates-candidate',
            pending_testing_tag=u'dist-fc10-updates-testing-pending',
            pending_stable_tag=u'dist-fc10-updates-pending',
            override_tag=u'dist-fc10-override',
            branch=u'fc10',
            version=u'10')
        update.release = otherrel
        with mock.patch(target='uuid.uuid4', return_value='wat3'):
            update.assign_alias()
        idx = '0efffa96f7'
        eq_(update.alias, u'%s-%s-%s' % (update.release.id_prefix, year, idx))

        newest = self.get_update(name=u'nethack-2.5.8-1.fc10')
        with mock.patch(target='uuid.uuid4', return_value='wat4'):
            newest.assign_alias()
        idx = '0efffa96f7'
        eq_(update.alias, u'%s-%s-%s' % (update.release.id_prefix, year, idx))
예제 #4
0
    def test_epel_id(self):
        """ Make sure we can handle id_prefixes that contain dashes.
        eg: FEDORA-EPEL
        """
        # Create a normal Fedora update first
        update = self.obj
        with mock.patch(target='uuid.uuid4', return_value='wat'):
            update.assign_alias()
        idx = 'a3bbe1a8f2'
        eq_(update.alias, u'FEDORA-%s-%s' % (time.localtime()[0], idx))

        update = self.get_update(name=u'TurboGears-2.1-1.el5')
        release = model.Release(
            name=u'EL-5',
            long_name=u'Fedora EPEL 5',
            id_prefix=u'FEDORA-EPEL',
            dist_tag=u'dist-5E-epel',
            stable_tag=u'dist-5E-epel',
            testing_tag=u'dist-5E-epel-testing',
            candidate_tag=u'dist-5E-epel-testing-candidate',
            pending_testing_tag=u'dist-5E-epel-testing-pending',
            pending_stable_tag=u'dist-5E-epel-pending',
            override_tag=u'dist-5E-epel-override',
            branch=u'el5',
            version=u'5')
        update.release = release
        idx = 'a3bbe1a8f2'
        with mock.patch(target='uuid.uuid4', return_value='wat'):
            update.assign_alias()
        eq_(update.alias, u'FEDORA-EPEL-%s-%s' % (time.localtime()[0], idx))

        update = self.get_update(name=u'TurboGears-2.2-1.el5')
        update.release = release
        idx = '016462d41f'
        with mock.patch(target='uuid.uuid4', return_value='wat2'):
            update.assign_alias()
        eq_(update.alias,
            u'%s-%s-%s' % (release.id_prefix, time.localtime()[0], idx))
예제 #5
0
 def do_get_dependencies(self):
     return dict(
         release=model.Release(**TestRelease.attrs),
         package=model.Package(**TestPackage.attrs),
     )