diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-25 07:01:32 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-25 07:01:32 +0000 |
commit | 42c179873afdc4ea9634b0e0fbaf391298880998 (patch) | |
tree | a22a53603d2462b63a0570fdca5a2a8dc19a9596 /0013-Fix-unittests-for-clone-and-pre-push-hook-script.patch | |
parent | fd314ffd8a10deca32e1dc6e12b9fb516a66489d (diff) |
automatic import of rpkg
Diffstat (limited to '0013-Fix-unittests-for-clone-and-pre-push-hook-script.patch')
-rw-r--r-- | 0013-Fix-unittests-for-clone-and-pre-push-hook-script.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/0013-Fix-unittests-for-clone-and-pre-push-hook-script.patch b/0013-Fix-unittests-for-clone-and-pre-push-hook-script.patch new file mode 100644 index 0000000..991fb22 --- /dev/null +++ b/0013-Fix-unittests-for-clone-and-pre-push-hook-script.patch @@ -0,0 +1,49 @@ +From 1d82b7eaf98e695689a7dc10bd308030e3c13eea Mon Sep 17 00:00:00 2001 +From: Ondrej Nosek <onosek@redhat.com> +Date: Sat, 1 Apr 2023 01:34:34 +0200 +Subject: [PATCH] Fix unittests for `clone` and pre-push hook script + +Signed-off-by: Ondrej Nosek <onosek@redhat.com> +--- + tests/commands/test_clone.py | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/tests/commands/test_clone.py b/tests/commands/test_clone.py +index 6ef1300..85fdfd1 100644 +--- a/tests/commands/test_clone.py ++++ b/tests/commands/test_clone.py +@@ -1,5 +1,6 @@ + import os + import shutil ++import sys + import tempfile + + import git +@@ -110,9 +111,10 @@ class CommandCloneTestCase(CommandTestCase): + moduledir = os.path.join(self.path, self.module) + self.assertTrue(os.path.isfile(os.path.join(moduledir, '.git/hooks/pre-push'))) + ++ clonned_by = os.path.basename(sys.argv[0]) + with open(os.path.join(moduledir, '.git/hooks/pre-push')) as git_hook_script: + content = git_hook_script.read() +- pattern = '__main__.py pre-push-check "$local_sha"' ++ pattern = '{0} pre-push-check "$local_sha"'.format(clonned_by) + self.assertIn(pattern, content) + + shutil.rmtree(altpath) +@@ -132,9 +134,11 @@ class CommandCloneTestCase(CommandTestCase): + moduledir = os.path.join(self.path, self.module) + self.assertTrue(os.path.isfile(os.path.join(moduledir, '.git/hooks/pre-push'))) + ++ clonned_by = os.path.basename(sys.argv[0]) + with open(os.path.join(moduledir, '.git/hooks/pre-push')) as git_hook_script: + content = git_hook_script.read() +- pattern = '__main__.py -C "/home/conf/rhpkg.conf" pre-push-check "$local_sha"' ++ pattern = '{0} -C "/home/conf/rhpkg.conf" pre-push-check ' \ ++ '"$local_sha"'.format(clonned_by) + self.assertIn(pattern, content) + + shutil.rmtree(altpath) +-- +2.39.2 + |