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')
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')