Ejemplo n.º 1
0
 def test_buildresult1(self):
     """project result"""
     br = BuildResult('test')
     res = br.result()
     self.assertTrue(len(res.result[:]) == 2)
     self.assertEqual(res.result[0].get('project'), 'test')
     self.assertEqual(res.result[0].get('repository'), 'openSUSE_Factory')
     self.assertEqual(res.result[0].get('arch'), 'i586')
     self.assertEqual(res.result[0].get('state'), 'building')
     self.assertTrue(len(res.result[0].status[:]) == 3)
     self.assertEqual(res.result[0].status[0].get('package'), 'foo')
     self.assertEqual(res.result[0].status[0].get('code'), 'disabled')
     self.assertEqual(res.result[0].status[0].details, '')
     self.assertEqual(res.result[0].status[1].get('package'), 'bar')
     self.assertEqual(res.result[0].status[1].get('code'), 'succeeded')
     self.assertEqual(res.result[0].status[1].details, '')
     self.assertEqual(res.result[0].status[2].get('package'), 'osc')
     self.assertEqual(res.result[0].status[2].get('code'), 'building')
     self.assertEqual(res.result[0].status[2].details, 'builds on host foo')
     # x86_64
     self.assertEqual(res.result[1].get('project'), 'test')
     self.assertEqual(res.result[1].get('repository'), 'openSUSE_Factory')
     self.assertEqual(res.result[1].get('arch'), 'x86_64')
     self.assertEqual(res.result[1].get('state'), 'building')
     self.assertEqual(res.result[1].get('dirty'), 'true')
     self.assertTrue(len(res.result[1].status[:]) == 3)
     self.assertEqual(res.result[1].status[0].get('package'), 'foo')
     self.assertEqual(res.result[1].status[0].get('code'), 'disabled')
     self.assertEqual(res.result[1].status[0].details, '')
     self.assertEqual(res.result[1].status[1].get('package'), 'bar')
     self.assertEqual(res.result[1].status[1].get('code'), 'succeeded')
     self.assertEqual(res.result[1].status[1].details, '')
     self.assertEqual(res.result[1].status[2].get('package'), 'osc')
     self.assertEqual(res.result[1].status[2].get('code'), 'succeeded')
     self.assertEqual(res.result[1].status[2].details, '')
Ejemplo n.º 2
0
 def test_logfile1(self):
     """get the logfile"""
     br = BuildResult('test', package='osc', repository='repo', arch='i586')
     log = br.log()
     self.assertEqual(log.read(), 'logfile')
     log.seek(3)
     self.assertEqual(log.read(), 'file')
Ejemplo n.º 3
0
 def test_buildresult1(self):
     """project result"""
     br = BuildResult('test')
     res = br.result()
     self.assertTrue(len(res.result[:]) == 2)
     self.assertEqual(res.result[0].get('project'), 'test')
     self.assertEqual(res.result[0].get('repository'), 'openSUSE_Factory')
     self.assertEqual(res.result[0].get('arch'), 'i586')
     self.assertEqual(res.result[0].get('state'), 'building')
     self.assertTrue(len(res.result[0].status[:]) == 3)
     self.assertEqual(res.result[0].status[0].get('package'), 'foo')
     self.assertEqual(res.result[0].status[0].get('code'), 'disabled')
     self.assertEqual(res.result[0].status[0].details, '')
     self.assertEqual(res.result[0].status[1].get('package'), 'bar')
     self.assertEqual(res.result[0].status[1].get('code'), 'succeeded')
     self.assertEqual(res.result[0].status[1].details, '')
     self.assertEqual(res.result[0].status[2].get('package'), 'osc')
     self.assertEqual(res.result[0].status[2].get('code'), 'building')
     self.assertEqual(res.result[0].status[2].details, 'builds on host foo')
     # x86_64
     self.assertEqual(res.result[1].get('project'), 'test')
     self.assertEqual(res.result[1].get('repository'), 'openSUSE_Factory')
     self.assertEqual(res.result[1].get('arch'), 'x86_64')
     self.assertEqual(res.result[1].get('state'), 'building')
     self.assertEqual(res.result[1].get('dirty'), 'true')
     self.assertTrue(len(res.result[1].status[:]) == 3)
     self.assertEqual(res.result[1].status[0].get('package'), 'foo')
     self.assertEqual(res.result[1].status[0].get('code'), 'disabled')
     self.assertEqual(res.result[1].status[0].details, '')
     self.assertEqual(res.result[1].status[1].get('package'), 'bar')
     self.assertEqual(res.result[1].status[1].get('code'), 'succeeded')
     self.assertEqual(res.result[1].status[1].details, '')
     self.assertEqual(res.result[1].status[2].get('package'), 'osc')
     self.assertEqual(res.result[1].status[2].get('code'), 'succeeded')
     self.assertEqual(res.result[1].status[2].details, '')
Ejemplo n.º 4
0
 def test_logfile1(self):
     """get the logfile"""
     br = BuildResult('test', package='osc', repository='repo', arch='i586')
     log = br.log()
     self.assertEqual(log.read(), 'logfile')
     log.seek(3)
     self.assertEqual(log.read(), 'file')
Ejemplo n.º 5
0
    def _fetch_cpio(self, defer_error=False):
        """Fetches bdeps from the api in a cpio archive.

        It tries to fetch all bdeps from the self._cpio_todo dict.
        A BuildDependencyFetchError is raised if a bdep cannot be
        fetched.

        Keyword arguments:
        defer_error -- if True it does not fail immediately if a bdep is
                       not found and tries to fetch the remaining bdeps
                       (default: False)

        """
        errors = ''
        missing_bdeps = []
        for prpap in sorted(self._cpio_todo.keys()):
            project, repo, arch, package = prpap.split('/', 4)
            br = BuildResult(project, package, repo, arch)
            binary = []
            # maps a cpio entry name to the corresponding bdep
            cpio_bdep = {}
            bdeps = self._cpio_todo[prpap]
            for bdep in bdeps:
                if package == '_repository':
                    name = bdep.get('name')
                    binary.append(name)
                    cpio_bdep[name + '.' + bdep.get('binarytype')] = bdep
                else:
                    binary.append(bdep.get('filename'))
                    cpio_bdep[bdep.get('filename')] = bdep
                self._notifier.pre_fetch(bdep, self.find_fetch_result(bdep))
            archive = br.binarylist(view='cpio', binary=binary)
            for archive_file in archive:
                if archive_file.hdr.name == '.errors':
                    errors += "\n" + archive_file.read().strip()
                    continue
                bdep = cpio_bdep[archive_file.hdr.name]
                self._cmgr.write(bdep, archive_file)
            # check if we got all files
            for bdep in bdeps:
                exists = self._cmgr.exists(bdep)
                fr = self.find_fetch_result(bdep)
                if fr is None:
                    # fr might be None if fetch was invoked with
                    # use_mirrors=False
                    fr = BuildDependencyFetcher.FetchResult(
                        bdep, exists, [], False)
                    self.fetch_results.append(fr)
                if exists:
                    self._notifier.post_fetch(bdep, fr)
                else:
                    missing_bdeps.append(fr)
            if missing_bdeps and not defer_error:
                break
        if missing_bdeps:
            raise BuildDependencyFetchError(missing_bdeps, errors.strip())
Ejemplo n.º 6
0
    def _fetch_cpio(self, defer_error=False):
        """Fetches bdeps from the api in a cpio archive.

        It tries to fetch all bdeps from the self._cpio_todo dict.
        A BuildDependencyFetchError is raised if a bdep cannot be
        fetched.

        Keyword arguments:
        defer_error -- if True it does not fail immediately if a bdep is
                       not found and tries to fetch the remaining bdeps
                       (default: False)

        """
        errors = ''
        missing_bdeps = []
        for prpap in sorted(self._cpio_todo.keys()):
            project, repo, arch, package = prpap.split('/', 4)
            br = BuildResult(project, package, repo, arch)
            binary = []
            # maps a cpio entry name to the corresponding bdep
            cpio_bdep = {}
            bdeps = self._cpio_todo[prpap]
            for bdep in bdeps:
                if package == '_repository':
                    name = bdep.get('name')
                    binary.append(name)
                    cpio_bdep[name + '.' + bdep.get('binarytype')] = bdep
                else:
                    binary.append(bdep.get('filename'))
                    cpio_bdep[bdep.get('filename')] = bdep
                self._notifier.pre_fetch(bdep, self.find_fetch_result(bdep))
            archive = br.binarylist(view='cpio', binary=binary)
            for archive_file in archive:
                if archive_file.hdr.name == '.errors':
                    errors += "\n" + archive_file.read().strip()
                    continue
                bdep = cpio_bdep[archive_file.hdr.name]
                self._cmgr.write(bdep, archive_file)
            # check if we got all files
            for bdep in bdeps:
                exists = self._cmgr.exists(bdep)
                fr = self.find_fetch_result(bdep)
                if fr is None:
                    # fr might be None if fetch was invoked with
                    # use_mirrors=False
                    fr = BuildDependencyFetcher.FetchResult(bdep, exists, [],
                                                            False)
                    self.fetch_results.append(fr)
                if exists:
                    self._notifier.post_fetch(bdep, fr)
                else:
                    missing_bdeps.append(fr)
            if missing_bdeps and not defer_error:
                break
        if missing_bdeps:
            raise BuildDependencyFetchError(missing_bdeps, errors.strip())
Ejemplo n.º 7
0
 def test_binarylist5(self):
     """test the cpio view (only some binaries)"""
     br = BuildResult('test', repository='repo', arch='x86_64')
     archive = br.binarylist(view='cpio', binary=['foo', 'bar'])
     it = iter(archive)
     archive_file = next(it)
     self.assertEqual(archive_file.read(), 'foo\n')
     archive_file = next(it)
     self.assertEqual(archive_file.read(), 'bar\n')
     self.assertRaises(StopIteration, it.__next__)
Ejemplo n.º 8
0
 def test_binarylist5(self):
     """test the cpio view (only some binaries)"""
     br = BuildResult('test', repository='repo', arch='x86_64')
     archive = br.binarylist(view='cpio', binary=['foo', 'bar'])
     it = iter(archive)
     archive_file = it.next()
     self.assertEqual(archive_file.read(), 'foo\n')
     archive_file = it.next()
     self.assertEqual(archive_file.read(), 'bar\n')
     self.assertRaises(StopIteration, it.next)
Ejemplo n.º 9
0
 def test_builddepinfo2(self):
     """test builddepinfo (reverse=True)"""
     br = BuildResult('test', package='foo', repository='repo',
                      arch='x86_64')
     info = br.builddepinfo(reverse=True)
     self.assertEqual(info.package[0].get('name'), 'foo')
     self.assertEqual(info.package[0].source, 'foo')
     self.assertEqual(info.package[0].pkgdep, 'bar')
     self.assertEqual(info.package[0].subpkg, 'foo')
     self.assertEqual(info.cycle[0].package[0], 'bar')
     self.assertEqual(info.cycle[0].package[1], 'foobar')
Ejemplo n.º 10
0
 def test_binarylist4(self):
     """test the cpio view (complete repo)"""
     br = BuildResult('test', repository='repo', arch='x86_64')
     archive = br.binarylist(view='cpio')
     it = iter(archive)
     archive_file = it.next()
     self.assertEqual(archive_file.read(), 'foo\n')
     archive_file = it.next()
     self.assertEqual(archive_file.read(), 'bar\n')
     archive_file = it.next()
     self.assertEqual(archive_file.read(), 'glibc\n')
     self.assertRaises(StopIteration, it.next)
Ejemplo n.º 11
0
 def test_binarylist4(self):
     """test the cpio view (complete repo)"""
     br = BuildResult('test', repository='repo', arch='x86_64')
     archive = br.binarylist(view='cpio')
     it = iter(archive)
     archive_file = next(it)
     self.assertEqual(archive_file.read(), 'foo\n')
     archive_file = next(it)
     self.assertEqual(archive_file.read(), 'bar\n')
     archive_file = next(it)
     self.assertEqual(archive_file.read(), 'glibc\n')
     self.assertRaises(StopIteration, it.__next__)
Ejemplo n.º 12
0
 def test_builddepinfo2(self):
     """test builddepinfo (reverse=True)"""
     br = BuildResult('test',
                      package='foo',
                      repository='repo',
                      arch='x86_64')
     info = br.builddepinfo(reverse=True)
     self.assertEqual(info.package[0].get('name'), 'foo')
     self.assertEqual(info.package[0].source, 'foo')
     self.assertEqual(info.package[0].pkgdep, 'bar')
     self.assertEqual(info.package[0].subpkg, 'foo')
     self.assertEqual(info.cycle[0].package[0], 'bar')
     self.assertEqual(info.cycle[0].package[1], 'foobar')
Ejemplo n.º 13
0
 def test_binarylist1(self):
     """list binaries for project repo arch"""
     br = BuildResult('test', repository='openSUSE_Factory', arch='i586')
     blist = br.binarylist()
     self.assertTrue(len(blist.binary[:]) == 3)
     self.assertEqual(blist.binary[0].get('filename'), 'osc.rpm')
     self.assertEqual(blist.binary[0].get('size'), '1294')
     self.assertEqual(blist.binary[0].get('mtime'), '1305804056')
     self.assertEqual(blist.binary[1].get('filename'), 'glibc.rpm')
     self.assertEqual(blist.binary[1].get('size'), '12244')
     self.assertEqual(blist.binary[1].get('mtime'), '1355804056')
     self.assertEqual(blist.binary[2].get('filename'), 'glibc-devel.rpm')
     self.assertEqual(blist.binary[2].get('size'), '122')
     self.assertEqual(blist.binary[2].get('mtime'), '1355804055')
Ejemplo n.º 14
0
 def test_binarylist1(self):
     """list binaries for project repo arch"""
     br = BuildResult('test', repository='openSUSE_Factory', arch='i586')
     blist = br.binarylist()
     self.assertTrue(len(blist.binary[:]) == 3)
     self.assertEqual(blist.binary[0].get('filename'), 'osc.rpm')
     self.assertEqual(blist.binary[0].get('size'), '1294')
     self.assertEqual(blist.binary[0].get('mtime'), '1305804056')
     self.assertEqual(blist.binary[1].get('filename'), 'glibc.rpm')
     self.assertEqual(blist.binary[1].get('size'), '12244')
     self.assertEqual(blist.binary[1].get('mtime'), '1355804056')
     self.assertEqual(blist.binary[2].get('filename'), 'glibc-devel.rpm')
     self.assertEqual(blist.binary[2].get('size'), '122')
     self.assertEqual(blist.binary[2].get('mtime'), '1355804055')
Ejemplo n.º 15
0
 def test_builddepinfo3(self):
     """test schema validation"""
     # misuse the binarylist schema
     schema_filename = 'binarylist_simple.xsd'
     BuildResult.BUILDDEPINFO_SCHEMA = self.fixture_file(schema_filename)
     br = BuildResult('test', repository='repo', arch='x86_64')
     self.assertRaises(etree.DocumentInvalid, br.builddepinfo)
Ejemplo n.º 16
0
 def test_builddepinfo1(self):
     """test builddepinfo"""
     br = BuildResult('test', repository='repo', arch='x86_64')
     info = br.builddepinfo()
     self.assertTrue(len(info.package[:]) == 2)
     self.assertEqual(info.package[0].get('name'), 'osc')
     self.assertEqual(info.package[0].source, 'osc')
     self.assertEqual(info.package[0].pkgdep[0], 'python')
     self.assertEqual(info.package[0].pkgdep[1], 'python-devel')
     self.assertEqual(info.package[0].subpkg[0], 'osc')
     self.assertEqual(info.package[0].subpkg[1], 'osc-doc')
     self.assertEqual(info.package[1].get('name'), 'foo')
     self.assertEqual(info.package[1].source, 'foo')
     self.assertEqual(info.package[1].pkgdep, 'bar')
     self.assertEqual(info.package[1].subpkg, 'foo')
     self.assertEqual(info.cycle[0].package[0], 'bar')
     self.assertEqual(info.cycle[0].package[1], 'foobar')
Ejemplo n.º 17
0
 def test_builddepinfo1(self):
     """test builddepinfo"""
     br = BuildResult('test', repository='repo', arch='x86_64')
     info = br.builddepinfo()
     self.assertTrue(len(info.package[:]) == 2)
     self.assertEqual(info.package[0].get('name'), 'osc')
     self.assertEqual(info.package[0].source, 'osc')
     self.assertEqual(info.package[0].pkgdep[0], 'python')
     self.assertEqual(info.package[0].pkgdep[1], 'python-devel')
     self.assertEqual(info.package[0].subpkg[0], 'osc')
     self.assertEqual(info.package[0].subpkg[1], 'osc-doc')
     self.assertEqual(info.package[1].get('name'), 'foo')
     self.assertEqual(info.package[1].source, 'foo')
     self.assertEqual(info.package[1].pkgdep, 'bar')
     self.assertEqual(info.package[1].subpkg, 'foo')
     self.assertEqual(info.cycle[0].package[0], 'bar')
     self.assertEqual(info.cycle[0].package[1], 'foobar')
Ejemplo n.º 18
0
 def test_buildresult5(self):
     """package repo arch result"""
     br = BuildResult('test', package='bar', repository='openSUSE_Factory',
                      arch='x86_64')
     res = br.result(x='y')
     self.assertTrue(len(res.result[:]) == 1)
     self.assertEqual(res.result[0].get('project'), 'test')
     self.assertEqual(res.result[0].get('repository'), 'openSUSE_Factory')
     self.assertEqual(res.result[0].get('arch'), 'x86_64')
     self.assertEqual(res.result[0].get('state'), 'building')
     self.assertEqual(res.result[0].get('dirty'), 'true')
     self.assertEqual(res.result[0].status[0].get('package'), 'bar')
     self.assertEqual(res.result[0].status[0].get('code'), 'excluded')
     self.assertEqual(res.result[0].status[0].details, '')
     # check unknown element
     self.assertRaises(AttributeError, res.result[0].status[0].__getattr__,
                       'asdf')
Ejemplo n.º 19
0
 def test_buildresult5(self):
     """package repo arch result"""
     br = BuildResult('test',
                      package='bar',
                      repository='openSUSE_Factory',
                      arch='x86_64')
     res = br.result(x='y')
     self.assertTrue(len(res.result[:]) == 1)
     self.assertEqual(res.result[0].get('project'), 'test')
     self.assertEqual(res.result[0].get('repository'), 'openSUSE_Factory')
     self.assertEqual(res.result[0].get('arch'), 'x86_64')
     self.assertEqual(res.result[0].get('state'), 'building')
     self.assertEqual(res.result[0].get('dirty'), 'true')
     self.assertEqual(res.result[0].status[0].get('package'), 'bar')
     self.assertEqual(res.result[0].status[0].get('code'), 'excluded')
     self.assertEqual(res.result[0].status[0].details, '')
     # check unknown element
     self.assertRaises(AttributeError, res.result[0].status[0].__getattr__,
                       'asdf')
Ejemplo n.º 20
0
 def test_binarylist2(self):
     """list binaries for project repo arch and get each binary file"""
     br = BuildResult('test', repository='repo', arch='i586')
     blist = br.binarylist()
     self.assertTrue(len(blist.binary[:]) == 3)
     self.assertEqual(blist.binary[0].get('filename'), 'osc.rpm')
     self.assertEqual(blist.binary[0].get('size'), '1294')
     self.assertEqual(blist.binary[0].get('mtime'), '1305804056')
     self.assertEqual(blist.binary[1].get('filename'), 'glibc.rpm')
     self.assertEqual(blist.binary[1].get('size'), '12244')
     self.assertEqual(blist.binary[1].get('mtime'), '1355804056')
     self.assertEqual(blist.binary[2].get('filename'), 'glibc-devel.rpm')
     self.assertEqual(blist.binary[2].get('size'), '122')
     self.assertEqual(blist.binary[2].get('mtime'), '1355804055')
     bfile = blist.binary[0].file(a='b', c='d')
     self.assertEqual(bfile.read(), 'osc.rpm')
     bfile = blist.binary[1].file()
     self.assertEqual(bfile.read(), 'glibc.rpm')
     bfile = blist.binary[2].file()
     self.assertEqual(bfile.read(), 'glibc-devel.rpm')
Ejemplo n.º 21
0
 def test_binarylist2(self):
     """list binaries for project repo arch and get each binary file"""
     br = BuildResult('test', repository='repo', arch='i586')
     blist = br.binarylist()
     self.assertTrue(len(blist.binary[:]) == 3)
     self.assertEqual(blist.binary[0].get('filename'), 'osc.rpm')
     self.assertEqual(blist.binary[0].get('size'), '1294')
     self.assertEqual(blist.binary[0].get('mtime'), '1305804056')
     self.assertEqual(blist.binary[1].get('filename'), 'glibc.rpm')
     self.assertEqual(blist.binary[1].get('size'), '12244')
     self.assertEqual(blist.binary[1].get('mtime'), '1355804056')
     self.assertEqual(blist.binary[2].get('filename'), 'glibc-devel.rpm')
     self.assertEqual(blist.binary[2].get('size'), '122')
     self.assertEqual(blist.binary[2].get('mtime'), '1355804055')
     bfile = blist.binary[0].file(a='b', c='d')
     self.assertEqual(bfile.read(), 'osc.rpm')
     bfile = blist.binary[1].file()
     self.assertEqual(bfile.read(), 'glibc.rpm')
     bfile = blist.binary[2].file()
     self.assertEqual(bfile.read(), 'glibc-devel.rpm')
Ejemplo n.º 22
0
 def test_buildresult4(self):
     """package result"""
     br = BuildResult('test', package='bar')
     res = br.result()
     self.assertTrue(len(res.result[:]) == 2)
     self.assertEqual(res.result[0].get('project'), 'test')
     self.assertEqual(res.result[0].get('repository'), 'openSUSE_Factory')
     self.assertEqual(res.result[0].get('arch'), 'i586')
     self.assertEqual(res.result[0].get('state'), 'building')
     self.assertEqual(res.result[0].status[0].get('package'), 'bar')
     self.assertEqual(res.result[0].status[0].get('code'), 'finished')
     self.assertEqual(res.result[0].status[0].details, 'succeeded')
     # x86_64
     self.assertEqual(res.result[1].get('project'), 'test')
     self.assertEqual(res.result[1].get('repository'), 'openSUSE_Factory')
     self.assertEqual(res.result[1].get('arch'), 'x86_64')
     self.assertEqual(res.result[1].get('state'), 'building')
     self.assertEqual(res.result[1].get('dirty'), 'true')
     self.assertEqual(res.result[1].status[0].get('package'), 'bar')
     self.assertEqual(res.result[1].status[0].get('code'), 'excluded')
     self.assertEqual(res.result[1].status[0].details, '')
Ejemplo n.º 23
0
 def test_buildresult4(self):
     """package result"""
     br = BuildResult('test', package='bar')
     res = br.result()
     self.assertTrue(len(res.result[:]) == 2)
     self.assertEqual(res.result[0].get('project'), 'test')
     self.assertEqual(res.result[0].get('repository'), 'openSUSE_Factory')
     self.assertEqual(res.result[0].get('arch'), 'i586')
     self.assertEqual(res.result[0].get('state'), 'building')
     self.assertEqual(res.result[0].status[0].get('package'), 'bar')
     self.assertEqual(res.result[0].status[0].get('code'), 'finished')
     self.assertEqual(res.result[0].status[0].details, 'succeeded')
     # x86_64
     self.assertEqual(res.result[1].get('project'), 'test')
     self.assertEqual(res.result[1].get('repository'), 'openSUSE_Factory')
     self.assertEqual(res.result[1].get('arch'), 'x86_64')
     self.assertEqual(res.result[1].get('state'), 'building')
     self.assertEqual(res.result[1].get('dirty'), 'true')
     self.assertEqual(res.result[1].status[0].get('package'), 'bar')
     self.assertEqual(res.result[1].status[0].get('code'), 'excluded')
     self.assertEqual(res.result[1].status[0].details, '')
Ejemplo n.º 24
0
 def test_buildresult3(self):
     """project repo arch result"""
     br = BuildResult('test', repository='openSUSE_Factory', arch='x86_64')
     res = br.result()
     # result is the same as in test1 for arch x86_64 (small check here)
     self.assertTrue(len(res.result[:]) == 1)
Ejemplo n.º 25
0
 def test_buildresult6(self):
     """test validation"""
     # misuse the binarylist schema
     BuildResult.RESULT_SCHEMA = self.fixture_file('binarylist_simple.xsd')
     br = BuildResult('test')
     self.assertRaises(etree.DocumentInvalid, br.result)
Ejemplo n.º 26
0
 def test_buildresult2(self):
     """project repo result"""
     br = BuildResult('test', repository='openSUSE_Factory')
     res = br.result()
     # result is the same as in test1 (so just do a small check here)
     self.assertTrue(len(res.result[:]) == 2)
Ejemplo n.º 27
0
 def test_buildresult2(self):
     """project repo result"""
     br = BuildResult('test', repository='openSUSE_Factory')
     res = br.result()
     # result is the same as in test1 (so just do a small check here)
     self.assertTrue(len(res.result[:]) == 2)
Ejemplo n.º 28
0
 def test_buildresult3(self):
     """project repo arch result"""
     br = BuildResult('test', repository='openSUSE_Factory', arch='x86_64')
     res = br.result()
     # result is the same as in test1 for arch x86_64 (small check here)
     self.assertTrue(len(res.result[:]) == 1)
Ejemplo n.º 29
0
 def test_binarylist3(self):
     """return an invalid binarylist xml (test validation)"""
     br = BuildResult('test', package='osc', repository='repo', arch='i586')
     BinaryList.SCHEMA = self.fixture_file('binarylist_simple.xsd')
     self.assertRaises(etree.DocumentInvalid, br.binarylist)
Ejemplo n.º 30
0
 def test_logfile2(self):
     """try to get logfile with insufficient arguments (package missing)"""
     br = BuildResult('test', repository='repo', arch='x86_64')
     self.assertRaises(ValueError, br.log)