public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/util/
@ 2019-10-21 19:42 Zac Medico
  0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2019-10-21 19:42 UTC (permalink / raw
  To: gentoo-commits

commit:     0299aedef74e47c0a68acf7905d8714c9578f125
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 21 19:40:46 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 21 19:42:19 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0299aede

GetConfigTestCase: update FETCHCOMMAND_RSYNC

Bug: https://bugs.gentoo.org/698046
Fixes: 03c54e340073 ("make.globals: Change FETCHCOMMAND_RSYNC to --copy-links")
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/util/test_getconfig.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/portage/tests/util/test_getconfig.py b/lib/portage/tests/util/test_getconfig.py
index e79fca4b9..a0d00d0e1 100644
--- a/lib/portage/tests/util/test_getconfig.py
+++ b/lib/portage/tests/util/test_getconfig.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2017 Gentoo Foundation
+# Copyright 2010-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import tempfile
@@ -19,7 +19,7 @@ class GetConfigTestCase(TestCase):
 
 	_cases = {
 		'FETCHCOMMAND'             : 'wget -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}"',
-		'FETCHCOMMAND_RSYNC'       : 'rsync -avP "${URI}" "${DISTDIR}/${FILE}"',
+		'FETCHCOMMAND_RSYNC'       : 'rsync -LtvP "${URI}" "${DISTDIR}/${FILE}"',
 		'FETCHCOMMAND_SFTP'        : 'bash -c "x=\\${2#sftp://} ; host=\\${x%%/*} ; port=\\${host##*:} ; host=\\${host%:*} ; [[ \\${host} = \\${port} ]] && port= ; eval \\"declare -a ssh_opts=(\\${3})\\" ; exec sftp \\${port:+-P \\${port}} \\"\\${ssh_opts[@]}\\" \\"\\${host}:/\\${x#*/}\\" \\"\\$1\\"" sftp "${DISTDIR}/${FILE}" "${URI}" "${PORTAGE_SSH_OPTS}"',
 		'FETCHCOMMAND_SSH'         : 'bash -c "x=\\${2#ssh://} ; host=\\${x%%/*} ; port=\\${host##*:} ; host=\\${host%:*} ; [[ \\${host} = \\${port} ]] && port= ; exec rsync --rsh=\\"ssh \\${port:+-p\\${port}} \\${3}\\" -avP \\"\\${host}:/\\${x#*/}\\" \\"\\$1\\"" rsync "${DISTDIR}/${FILE}" "${URI}" "${PORTAGE_SSH_OPTS}"',
 		'PORTAGE_ELOG_MAILSUBJECT' : '[portage] ebuild log for ${PACKAGE} on ${HOST}'


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/util/
@ 2020-08-03 21:42 Zac Medico
  0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2020-08-03 21:42 UTC (permalink / raw
  To: gentoo-commits

commit:     39d963d6d0b26040f04ebcbe65145c37c85deaec
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 20:20:30 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 21:25:54 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=39d963d6

lib/portage/tests/util/test_getconfig.py: drop unused-import

* Drop unused-import
* Update copyright

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/util/test_getconfig.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/portage/tests/util/test_getconfig.py b/lib/portage/tests/util/test_getconfig.py
index a0d00d0e1..90e039cba 100644
--- a/lib/portage/tests/util/test_getconfig.py
+++ b/lib/portage/tests/util/test_getconfig.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2019 Gentoo Authors
+# Copyright 2010-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import tempfile
@@ -6,7 +6,6 @@ import tempfile
 from portage import os
 from portage import shutil
 from portage import _unicode_encode
-from portage.const import PORTAGE_BASE_PATH
 from portage.tests import TestCase
 from portage.util import getconfig
 from portage.exception import ParseError


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/util/
@ 2022-09-18 18:30 Mike Gilbert
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Gilbert @ 2022-09-18 18:30 UTC (permalink / raw
  To: gentoo-commits

commit:     fa2f4995680414c6f1b852a97655c7ced02f816f
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 18 17:32:23 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Sep 18 17:37:50 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fa2f4995

Add test to cover portage.checksum._apply_hash_filter

Thanks-to: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 lib/portage/tests/util/test_checksum.py | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/lib/portage/tests/util/test_checksum.py b/lib/portage/tests/util/test_checksum.py
index da864ba22..0e49f882f 100644
--- a/lib/portage/tests/util/test_checksum.py
+++ b/lib/portage/tests/util/test_checksum.py
@@ -1,9 +1,9 @@
-# Copyright 2011-2017 Gentoo Foundation
+# Copyright 2011-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
 
-from portage.checksum import checksum_str
+from portage.checksum import checksum_str, _apply_hash_filter
 from portage.exception import DigestException
 
 
@@ -146,3 +146,26 @@ class ChecksumTestCase(TestCase):
             )
         except DigestException:
             self.skipTest("STREEBOG512 implementation not available")
+
+
+class ApplyHashFilterTestCase(TestCase):
+    def test_apply_hash_filter(self):
+        indict = {"MD5": "", "SHA1": "", "SHA256": "", "size": ""}
+
+        self.assertEqual(
+            sorted(_apply_hash_filter(indict, lambda x: True)),
+            ["MD5", "SHA1", "SHA256", "size"],
+        )
+        self.assertEqual(
+            sorted(_apply_hash_filter(indict, lambda x: x == "MD5")), ["MD5", "size"]
+        )
+        self.assertEqual(
+            sorted(_apply_hash_filter(indict, lambda x: x != "MD5")),
+            ["SHA1", "SHA256", "size"],
+        )
+        self.assertEqual(
+            sorted(_apply_hash_filter(indict, lambda x: x == "SHA256")),
+            ["SHA256", "size"],
+        )
+        # this should return size + one of the hashes
+        self.assertEqual(len(list(_apply_hash_filter(indict, lambda x: False))), 2)


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/util/
@ 2023-05-26 15:45 Sam James
  0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2023-05-26 15:45 UTC (permalink / raw
  To: gentoo-commits

commit:     d54772b10ef94b5381aa0772312f792aeccd132c
Author:     David Palao <david.palao <AT> gmail <DOT> com>
AuthorDate: Fri Apr 28 14:07:45 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 26 15:44:36 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d54772b1

tests: whirpool: skip C test conditionally w/ pytest

Signed-off-by: David Palao <david.palao <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/tests/util/test_whirlpool.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/portage/tests/util/test_whirlpool.py b/lib/portage/tests/util/test_whirlpool.py
index ac156abf3..4b3b9edaf 100644
--- a/lib/portage/tests/util/test_whirlpool.py
+++ b/lib/portage/tests/util/test_whirlpool.py
@@ -1,6 +1,8 @@
 # Copyright 2011-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+import pytest
+
 from portage.tests import TestCase
 from portage.util.whirlpool import CWhirlpool, PyWhirlpool
 
@@ -26,7 +28,9 @@ class WhirlpoolTestCase(TestCase):
             "19fa61d75522a4669b44e39c1d2e1726c530232130d407f89afee0964997f7a73e83be698b288febcf88e3e03c4f0757ea8964e59b63d93708b138cc42a66eb3",
         )
 
+    @pytest.mark.skipif(
+        not CWhirlpool.is_available,
+        reason="C Whirlpool extension is not importable",
+    )
     def testCWhirlpool(self):
-        if not CWhirlpool.is_available:
-            self.skipTest("C Whirlpool extension is not importable")
         self.testBundledWhirlpool(CWhirlpool)


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/util/
@ 2024-02-09 21:30 Zac Medico
  0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2024-02-09 21:30 UTC (permalink / raw
  To: gentoo-commits

commit:     d702c7684093dccae87df080d0b7701dddf95091
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  9 21:27:50 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb  9 21:30:10 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d702c768

ManifestTestCase: Remove tempdir

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/util/test_manifest.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/portage/tests/util/test_manifest.py b/lib/portage/tests/util/test_manifest.py
index 49bcbc1a54..3412d568d7 100644
--- a/lib/portage/tests/util/test_manifest.py
+++ b/lib/portage/tests/util/test_manifest.py
@@ -1,6 +1,7 @@
-# Copyright 2022 Gentoo Authors
+# Copyright 2022-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+import shutil
 import tempfile
 
 from pathlib import Path
@@ -29,3 +30,4 @@ class ManifestTestCase(TestCase):
             manifest.getFileData("AUX", "test.patch", "SHA512"),
             "e30d069dcf284cbcb2d5685f03ca362469026b469dec4f8655d0c9a2bf317f5d9f68f61855ea403f4959bc0b9c003ae824fb9d6ab2472a739950623523af9da9",
         )
+        shutil.rmtree(str(tempdir))


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/util/
@ 2024-02-09 22:20 Zac Medico
  0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2024-02-09 22:20 UTC (permalink / raw
  To: gentoo-commits

commit:     8dd69569b968ca0193b131c393e70855015a50dd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  9 22:19:22 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb  9 22:19:35 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8dd69569

ManifestTestCase: Fix tempdir removal

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/util/test_manifest.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/portage/tests/util/test_manifest.py b/lib/portage/tests/util/test_manifest.py
index 3412d568d7..2d41b9fc97 100644
--- a/lib/portage/tests/util/test_manifest.py
+++ b/lib/portage/tests/util/test_manifest.py
@@ -11,7 +11,8 @@ from portage.tests import TestCase
 
 class ManifestTestCase(TestCase):
     def test_simple_addFile(self):
-        tempdir = Path(tempfile.mkdtemp()) / "app-portage" / "diffball"
+        base_tempdir = tempfile.mkdtemp()
+        tempdir = Path(base_tempdir) / "app-portage" / "diffball"
         manifest = Manifest(str(tempdir), required_hashes=["SHA512", "BLAKE2B"])
 
         (tempdir / "files").mkdir(parents=True)
@@ -30,4 +31,4 @@ class ManifestTestCase(TestCase):
             manifest.getFileData("AUX", "test.patch", "SHA512"),
             "e30d069dcf284cbcb2d5685f03ca362469026b469dec4f8655d0c9a2bf317f5d9f68f61855ea403f4959bc0b9c003ae824fb9d6ab2472a739950623523af9da9",
         )
-        shutil.rmtree(str(tempdir))
+        shutil.rmtree(base_tempdir)


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-09 22:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-26 15:45 [gentoo-commits] proj/portage:master commit in: lib/portage/tests/util/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-02-09 22:20 Zac Medico
2024-02-09 21:30 Zac Medico
2022-09-18 18:30 Mike Gilbert
2020-08-03 21:42 Zac Medico
2019-10-21 19:42 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox