Exemplo n.º 1
0
    def test_ourVersionNewer(self):
        th.build_and_import_simple_package('foo', '2.0', self.target_repo)
        th.build_and_import_simple_package('foo', '1.0', self.source1_repo)

        target = config.targets()[0]
        th.update_all_distro_sources()
        pv = target.distro.findPackage('foo', version='2.0')[0]

        update_sources.handle_package(target, pv.package)
        update_info = UpdateInfo(pv.package)
        self.assertEqual(update_info.upstream_version, '1.0')
Exemplo n.º 2
0
    def test_noBase(self):
        th.build_and_import_simple_package('foo', '1.0-1mom1',
                                           self.target_repo)

        target = config.targets()[0]
        th.update_all_distro_sources()
        pv = target.distro.findPackage('foo', version='1.0-1mom1')[0]

        update_sources.handle_package(target, pv.package)
        update_info = UpdateInfo(pv.package)
        self.assertIsNone(update_info.base_version)
Exemplo n.º 3
0
    def test_unmodifiedUpgrade(self):
        testhelper.build_and_import_simple_package('foo', '1.0',
                                                   self.target_repo)
        testhelper.build_and_import_simple_package('foo', '2.0',
                                                   self.source1_repo)

        target = config.targets()[0]
        testhelper.update_all_distro_sources()
        pv = target.distro.findPackage('foo', version='1.0')[0]

        update_sources.handle_package(target, pv.package)
        update_info = UpdateInfo(pv.package)
        self.assertEqual(update_info.upstream_version, '2.0')
        self.assertEqual(update_info.base_version, '1.0')
Exemplo n.º 4
0
    def test_baseFromChangelog(self):
        foo = th.build_and_import_simple_package('foo', '3.0-1',
                                                 self.source1_repo)

        foo.changelog_entry('4.0-1mom1')
        foo.create_orig()
        foo.build()
        self.target_repo.importPackage(foo)

        target = config.targets()[0]
        th.update_all_distro_sources()
        pv = target.distro.findPackage('foo', version='4.0-1mom1')[0]

        update_sources.handle_package(target, pv.package)
        update_info = UpdateInfo(pv.package)
        self.assertEqual(update_info.base_version, '3.0-1')