mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 21:37:15 +02:00
testing/py3-lib_users: build with gpep517, run tests
This commit is contained in:
parent
99d0279ef5
commit
c4fe064348
@ -3,32 +3,39 @@
|
||||
pkgname=py3-lib_users
|
||||
_pkgname=lib_users
|
||||
pkgver=0.15
|
||||
pkgrel=3
|
||||
pkgrel=4
|
||||
pkgdesc="Checks /proc for libraries being mapped but marked as deleted"
|
||||
url="https://github.com/klausman/lib_users"
|
||||
arch="noarch"
|
||||
license="GPL-2.0-or-later"
|
||||
depends="python3"
|
||||
makedepends="py3-setuptools"
|
||||
options="!check" # https://bugs.python.org/issue29130
|
||||
makedepends="py3-setuptools py3-gpep517"
|
||||
subpackages="$pkgname-pyc"
|
||||
source="$pkgname-$pkgver.tar.gz::https://github.com/klausman/lib_users/archive/v$pkgver.tar.gz
|
||||
setuptools.patch"
|
||||
setuptools.patch
|
||||
assertEquals.patch
|
||||
"
|
||||
builddir="$srcdir"/$_pkgname-$pkgver
|
||||
|
||||
build() {
|
||||
python3 setup.py build
|
||||
gpep517 build-wheel \
|
||||
--wheel-dir .dist \
|
||||
--output-fd 3 3>&1 >&2
|
||||
}
|
||||
|
||||
check() {
|
||||
python3 -m unittest
|
||||
python3 -m venv --clear --without-pip --system-site-packages .testenv
|
||||
gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
|
||||
.testenv/bin/python3 -m unittest discover || [ "$?" = "120" ] # https://bugs.python.org/issue29130
|
||||
}
|
||||
|
||||
package() {
|
||||
python3 setup.py install --skip-build --root="$pkgdir"
|
||||
gpep517 install-wheel --destdir "$pkgdir" \
|
||||
.dist/*.whl
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
f9eab0d7c634602c496154dc20bd8374842df77c6abfaf69a0c34013f01c3a7541a006cb2b027539f6c088a55bea78682bf156723899d614f39ee48773fb9ea8 py3-lib_users-0.15.tar.gz
|
||||
c1b18709799af0f6ae5a0644beb0a95c709d07e28033fd68801cabe042ed0dbbaa3b7f1efe88a078f53a200f074e198404dc11fc149a85832035e8389577921d setuptools.patch
|
||||
94b286369144f45df6c59c3141d32bc2f205630b404043eb9de6a86c908419317e6711140984fff369b64b6bb030401093d2ea0f346815eca544cb4adb2c1175 assertEquals.patch
|
||||
"
|
||||
|
116
testing/py3-lib_users/assertEquals.patch
Normal file
116
testing/py3-lib_users/assertEquals.patch
Normal file
@ -0,0 +1,116 @@
|
||||
diff --git a/test_fdusers.py b/test_fdusers.py
|
||||
index 0bbe29d..fb0b04a 100644
|
||||
--- a/test_fdusers.py
|
||||
+++ b/test_fdusers.py
|
||||
@@ -194,12 +194,12 @@ class Testlibuserswithmocks(unittest.TestCase):
|
||||
|
||||
def test_actual(self):
|
||||
"""Test main() in human mode"""
|
||||
- self.assertEquals(self.f_u.main([]), None)
|
||||
+ self.assertEqual(self.f_u.main([]), None)
|
||||
|
||||
def test_actual2(self):
|
||||
"""Test main() in machine mode"""
|
||||
- self.assertEquals(self.f_u.main(["-m"]), None)
|
||||
+ self.assertEqual(self.f_u.main(["-m"]), None)
|
||||
|
||||
def test_givenlist(self):
|
||||
"""Test main() in default mode"""
|
||||
- self.assertEquals(self.f_u.main([]), None)
|
||||
+ self.assertEqual(self.f_u.main([]), None)
|
||||
diff --git a/test_libusers.py b/test_libusers.py
|
||||
index f6fea84..cabf7e9 100644
|
||||
--- a/test_libusers.py
|
||||
+++ b/test_libusers.py
|
||||
@@ -79,7 +79,7 @@ class Testlibusers(unittest.TestCase):
|
||||
"/i915 (deleted)")
|
||||
pseudofile = StringIO("\n".join(pseudofile))
|
||||
res = lib_users.get_deleted_libs(pseudofile)
|
||||
- self.assertEquals(res, EMPTYSET)
|
||||
+ self.assertEqual(res, EMPTYSET)
|
||||
|
||||
def test_libs_with_patterns(self):
|
||||
"""Test detection of mappings that are libs but contain nonlib stuff"""
|
||||
@@ -105,7 +105,7 @@ class Testlibusers(unittest.TestCase):
|
||||
pseudofile = StringIO("\n".join(pseudofile))
|
||||
res = list(lib_users.get_deleted_libs(pseudofile))
|
||||
res.sort()
|
||||
- self.assertEquals(
|
||||
+ self.assertEqual(
|
||||
res, ['/lib/SYSV00000000', '/lib/[aio]', '/lib/dev/shm/foo',
|
||||
'/lib/dev/zero', '/lib/drm', '/usr/lib/i915'])
|
||||
|
||||
@@ -121,21 +121,21 @@ class Testlibusers(unittest.TestCase):
|
||||
'/v/t/p/sys-libs/glibc-2.15-r3/image/lib64/libdl-2.15.so',
|
||||
'/v/t/p/sys-libs/glibc-2.15-r3/image/lib64/ld-2.15.so'
|
||||
}
|
||||
- self.assertEquals(res, expected)
|
||||
+ self.assertEqual(res, expected)
|
||||
|
||||
def test_drm_mm_maps(self):
|
||||
"""Test that deleted DRM maps yield no results"""
|
||||
testdata = open("testdata/drm-mm-maps").read()
|
||||
pseudofile = StringIO(testdata)
|
||||
res = lib_users.get_deleted_libs(pseudofile)
|
||||
- self.assertEquals(res, EMPTYSET)
|
||||
+ self.assertEqual(res, EMPTYSET)
|
||||
|
||||
def test_findlibs(self):
|
||||
"""Test detection of "classic" lib name"""
|
||||
pseudofile = StringIO(
|
||||
"7f02a85f1000-7f02a85f2000 rw-p 0000c000 09:01 32642 "
|
||||
"/lib64/libfindme.so (deleted)")
|
||||
- self.assertEquals(
|
||||
+ self.assertEqual(
|
||||
lib_users.get_deleted_libs(pseudofile),
|
||||
set(["/lib64/libfindme.so"]))
|
||||
|
||||
@@ -144,28 +144,28 @@ class Testlibusers(unittest.TestCase):
|
||||
pseudofile = StringIO(
|
||||
"7f02a85fc000-7f02a87fb000 ---p 0000a000 09:01 32647 (deleted) "
|
||||
"/lib64/libdontfindme.so")
|
||||
- self.assertEquals(lib_users.get_deleted_libs(pseudofile), EMPTYSET)
|
||||
+ self.assertEqual(lib_users.get_deleted_libs(pseudofile), EMPTYSET)
|
||||
|
||||
def test_parennames(self):
|
||||
"""Test detection of libraries with embedded special strings"""
|
||||
pseudofile = StringIO(
|
||||
"7f02a87fc000-7f02a87fd000 rw-p 0000a000 09:01 32647 "
|
||||
"/lib64/libdontfindmeeither_(deleted)i-2.11.2.so")
|
||||
- self.assertEquals(lib_users.get_deleted_libs(pseudofile), EMPTYSET)
|
||||
+ self.assertEqual(lib_users.get_deleted_libs(pseudofile), EMPTYSET)
|
||||
|
||||
def test_parenwcontent(self):
|
||||
"""Test detection of superstrings of special strings"""
|
||||
pseudofile = StringIO(
|
||||
"7f02a87fc000-7f02a87fd000 rw-p 0000a000 09:01 32647 "
|
||||
"/lib64/libdontfindmeeither-2.11.2.so (notdeleted)")
|
||||
- self.assertEquals(lib_users.get_deleted_libs(pseudofile), EMPTYSET)
|
||||
+ self.assertEqual(lib_users.get_deleted_libs(pseudofile), EMPTYSET)
|
||||
|
||||
def test_parenwcontent2(self):
|
||||
"""Test detection of substrings of special strings"""
|
||||
pseudofile = StringIO(
|
||||
"7f02a87fc000-7f02a87fd000 rw-p 0000a000 09:01 32647 "
|
||||
"/lib64/libdontfindmeeither-2.11.2.so (delete)")
|
||||
- self.assertEquals(lib_users.get_deleted_libs(pseudofile), EMPTYSET)
|
||||
+ self.assertEqual(lib_users.get_deleted_libs(pseudofile), EMPTYSET)
|
||||
|
||||
|
||||
class Testlibuserswithmocks(unittest.TestCase):
|
||||
@@ -211,12 +211,12 @@ class Testlibuserswithmocks(unittest.TestCase):
|
||||
|
||||
def test_actual(self):
|
||||
"""Test main() in human mode"""
|
||||
- self.assertEquals(self.l_u.main([]), None)
|
||||
+ self.assertEqual(self.l_u.main([]), None)
|
||||
|
||||
def test_actual2(self):
|
||||
"""Test main() in machine mode"""
|
||||
- self.assertEquals(self.l_u.main(["-m"]), None)
|
||||
+ self.assertEqual(self.l_u.main(["-m"]), None)
|
||||
|
||||
def test_givenlist(self):
|
||||
"""Test main() in default mode"""
|
||||
- self.assertEquals(self.l_u.main([]), None)
|
||||
+ self.assertEqual(self.l_u.main([]), None)
|
Loading…
Reference in New Issue
Block a user