def test_2(self): expected = { 'SUNW_PRODVERS': '5.10/SunOS Development', 'PKG_CAS_PASSRELATIVE': ' none', 'PKG_SRC_NOVERIFY': ' none', 'PSTAMP': 'sfw10-patch-x20070430084427', 'ARCH': 'i386', 'EMAIL': '', 'MAXINST': '1000', 'PATCH_INFO_126547-01': 'Installed: Mon Oct 27 08:52:07 PDT 2008 From: mum Obsoletes: Requires: Incompatibles:', 'PKG': 'SUNWbash', 'SUNW_PKGTYPE': 'usr', 'PKG_DST_QKVERIFY': ' none', 'SUNW_PKGVERS': '1.0', 'VENDOR': 'Sun Microsystems, Inc.', 'BASEDIR': '/', 'CLASSES': 'none', 'PATCHLIST': '126547-01', 'DESC': 'GNU Bourne-Again shell (bash) version 3.0', 'CATEGORY': 'system', 'NAME': 'GNU Bourne-Again shell (bash)', 'SUNW_PRODNAME': 'SunOS', 'VERSION': '11.10.0,REV=2005.01.08.01.09', 'HOTLINE': 'Please contact your local service provider', } self.assertEquals(expected, opencsw.ParsePkginfo(TEST_PKGINFO.splitlines()))
def GetParsedPkginfo(self): if not self.pkginfo_dict: pkginfo_fd = open(self.GetPkginfoFilename(), "r") self.pkginfo_dict = opencsw.ParsePkginfo(pkginfo_fd) pkginfo_fd.close() return self.pkginfo_dict
def test_4(self): pkginfo_dict = opencsw.ParsePkginfo(TEST_PKGINFO.splitlines()) expected = "sunw_bash-11.10.0,REV=2005.01.08.01.09-SunOS5.10-i386-SUNW.pkg" self.assertEquals(expected, opencsw.PkginfoToSrv4Name(pkginfo_dict))