]>
git.ipfire.org Git - people/ms/pakfire.git/blob - tests/python/package.py
7 class Test(unittest
.TestCase
):
9 This tests the Package class
12 path
= os
.environ
.get("TEST_STUB_ROOT")
14 raise RuntimeError("TEST_STUB_ROOT is not defined")
16 self
.pakfire
= pakfire
.Pakfire(path
)
20 os
.environ
["TEST_DATA_DIR"],
21 "beep-1.3-2.ip3.x86_64.pfm",
25 a
= self
.pakfire
.open(path
)
31 self
.assertEqual(p
.name
, "beep")
32 self
.assertEqual(p
.evr
, "1.3-2.ipfire3")
33 self
.assertEqual(p
.arch
, "x86_64")
35 self
.assertEqual(p
.summary
, "Beep the PC speaker any number of ways.")
36 self
.assertEqual(p
.description
,
37 "Beep allows the user to control the PC speaker with precision, "
38 "allowing different sounds to indicate different events. While "
39 "it can be run quite happily on the commandline, it's intended "
40 "place of residence is within shell/perl scripts, notifying the "
41 "user when something interesting occurs. Of course, it has no "
42 "notion of what's interesting, but it's real good at that "
44 self
.assertEqual(p
.url
, "http://www.johnath.com/beep/")
45 self
.assertEqual(p
.license
, "GPLv2+")
46 self
.assertEqual(p
.vendor
, "IPFire Project")
47 self
.assertEqual(p
.distribution
, "ipfire3")
48 self
.assertEqual(p
.groups
, "Applications/System")
50 self
.assertEqual(p
.uuid
, "a20dddff-d8e8-4544-aaee-8bab618b0b3f")
51 self
.assertIsNone(p
.packager
)
53 self
.assertEqual(p
.filename
, "beep-1.3-2.ip3.x86_64.pfm")
54 self
.assertEqual(p
.downloadsize
, 11271)
55 self
.assertEqual(p
.installsize
, 40980)
57 self
.assertEqual(p
.buildhost
, "michael.sof.ipfire.org")
58 self
.assertEqual(p
.buildtime
, 1677608628)
61 self
.assertEqual(p
.requires
, [
62 "pakfire(Digest-SHA3-512)",
63 "pakfire(Digest-BLAKE2b512)",
64 "/lib64/ld-linux-x86-64.so.2",
66 "libc.so.6(GLIBC_2.2.5)(64bit)",
67 "libc.so.6(GLIBC_2.3.4)(64bit)",
68 "libc.so.6(GLIBC_2.34)(64bit)",
69 "libc.so.6(GLIBC_2.4)(64bit)",
70 "libc.so.6(GLIBC_2.7)(64bit)",
71 "pakfire(Compress-Zstandard)",
72 "pakfire(PackageFormat-6)",
74 self
.assertEqual(p
.provides
, ["beep = 1.3-2.ipfire3"])
75 self
.assertEqual(p
.obsoletes
, [])
76 self
.assertEqual(p
.conflicts
, [])
77 self
.assertEqual(p
.suggests
, [])
78 self
.assertEqual(p
.recommends
, [])
81 self
.assertEqual(p
.source_package
, "beep-1.3-2.ipfire3.src")
82 self
.assertEqual(p
.source_name
, "beep")
83 self
.assertEqual(p
.source_arch
, "src")
84 self
.assertEqual(p
.source_evr
, "1.3-2.ipfire3")
86 self
.assertEqual(p
.build_arches
, [])
89 algo
, digest
= p
.digest
91 self
.assertEqual(algo
, "sha2-512")
92 self
.assertEqual(digest
, b
"BP+\xb256\xc3\x12w\xf0l\xc2\xd7\x87j\xe3\xf0\x84\x85v\xc56B|\x8e\x99\x95\xf1 Z\xbf\xe7U\xa0C\xc8\xf1hklg{\x89\xa5\x98\x9e\nG\xdb!\ng\xbe\xa0\xcdt6\x04\x00\xeby\xd18\x91")
95 if __name__
== "__main__":