Compare commits
11 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| b43511c8f1 | |||
| 7c8866255a | |||
| 05b75f6b47 | |||
| 1e6e836087 | |||
| cd3001c571 | |||
| 583d4249e1 | |||
| 1ae726b6d6 | |||
| 6eebebdd57 | |||
| 0b03cf8849 | |||
| a2edb744ab | |||
| e9502bf04a |
@@ -1,86 +0,0 @@
|
||||
Index: grimoirelab-sortinghat-0.19.1/tests/test_schema.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-0.19.1.orig/tests/test_schema.py
|
||||
+++ grimoirelab-sortinghat-0.19.1/tests/test_schema.py
|
||||
@@ -22,6 +22,7 @@
|
||||
#
|
||||
|
||||
import datetime
|
||||
+import unittest
|
||||
import unittest.mock
|
||||
import json
|
||||
import httpretty
|
||||
@@ -1403,6 +1404,7 @@ class TestQueryPagination(django.test.Te
|
||||
self.assertEqual(pag_data['endIndex'], 6)
|
||||
self.assertEqual(pag_data['totalResults'], 6)
|
||||
|
||||
+ @unittest.skip("Broken")
|
||||
def test_page_size_negative(self):
|
||||
"""Check if it fails when `pageSize` is a negative number"""
|
||||
|
||||
@@ -6367,7 +6369,8 @@ class TestAddIdentityMutation(django.tes
|
||||
variables=params)
|
||||
|
||||
msg = executed['errors'][0]['message']
|
||||
- self.assertEqual(msg, INDIVIDUAL_DOES_NOT_EXIST_ERROR)
|
||||
+ self.assertEqual(
|
||||
+ msg, INDIVIDUAL_DOES_NOT_EXIST_ERROR.format(uuid=params['uuid']))
|
||||
|
||||
def test_add_identity_name_none(self):
|
||||
"""Check if the username is set to the profile when no name is provided"""
|
||||
@@ -8163,7 +8166,8 @@ class TestWithdrawMutation(django.test.T
|
||||
variables=params)
|
||||
|
||||
msg = executed['errors'][0]['message']
|
||||
- self.assertEqual(msg, INDIVIDUAL_DOES_NOT_EXIST_ERROR)
|
||||
+ self.assertEqual(
|
||||
+ msg, INDIVIDUAL_DOES_NOT_EXIST_ERROR.format(uuid=params['uuid']))
|
||||
|
||||
def test_non_existing_organization(self):
|
||||
"""Check if it fails when the organization does not exist"""
|
||||
@@ -9850,6 +9854,7 @@ class TestUnifyMutation(django.test.Test
|
||||
source='scm',
|
||||
uuid=self.jrae.uuid)
|
||||
|
||||
+ @unittest.skip("Broken")
|
||||
@unittest.mock.patch('sortinghat.core.jobs.rq.job.uuid4')
|
||||
def test_unify(self, mock_job_id_gen):
|
||||
"""Check if unify is applied for the specified individuals"""
|
||||
@@ -9922,6 +9927,7 @@ class TestUnifyMutation(django.test.Test
|
||||
id5 = identities[4]
|
||||
self.assertEqual(id5, self.jr2)
|
||||
|
||||
+ @unittest.skip("Broken")
|
||||
@unittest.mock.patch('sortinghat.core.jobs.rq.job.uuid4')
|
||||
def test_unify_last_modified(self, mock_job_id_gen):
|
||||
"""Check if unify is applied only for the individuals modified after a date"""
|
||||
Index: grimoirelab-sortinghat-0.19.1/tests/cli/test_cmd_config.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-0.19.1.orig/tests/cli/test_cmd_config.py
|
||||
+++ grimoirelab-sortinghat-0.19.1/tests/cli/test_cmd_config.py
|
||||
@@ -41,10 +41,10 @@ MOCK_CONFIG_FILEPATH = os.path.join(os.p
|
||||
|
||||
|
||||
CONFIG_FILE_EXISTS_ERROR = "Error: Configuration file {} already exists. Use '--overwrite' to replace it.\n"
|
||||
-INVALID_CONFIG_FILE = "Error: Could not open file {}: [Errno 21] Is a directory: '{}'\n"
|
||||
+INVALID_CONFIG_FILE = "Error: Could not open file '{}': [Errno 21] Is a directory: '{}'\n"
|
||||
SET_KEY_CONFIG_ERROR = "Error: {} config parameter is not supported\n"
|
||||
GET_KEY_CONFIG_ERROR = "Error: {} config parameter is not supported\n"
|
||||
-NOT_FOUND_FILE_ERROR = "Error: Could not open file {}: file does not exist\n"
|
||||
+NOT_FOUND_FILE_ERROR = "Error: Could not open file '{}': file does not exist\n"
|
||||
|
||||
|
||||
class TestInitConfig(unittest.TestCase):
|
||||
Index: grimoirelab-sortinghat-0.19.1/sortinghat/core/decorators.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-0.19.1.orig/sortinghat/core/decorators.py
|
||||
+++ grimoirelab-sortinghat-0.19.1/sortinghat/core/decorators.py
|
||||
@@ -68,6 +68,8 @@ check_auth = user_passes_test(lambda u:
|
||||
|
||||
|
||||
def check_permissions(perms):
|
||||
+ if isinstance(perms, str):
|
||||
+ perms = (perms,)
|
||||
return user_passes_test(lambda u: u.has_perms(perms))
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Index: grimoirelab-sortinghat-0.19.1/config/settings/testing.py
|
||||
Index: grimoirelab-sortinghat-1.2.1/config/settings/config_testing.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-0.19.1.orig/config/settings/testing.py
|
||||
+++ grimoirelab-sortinghat-0.19.1/config/settings/testing.py
|
||||
--- grimoirelab-sortinghat-1.2.1.orig/config/settings/config_testing.py
|
||||
+++ grimoirelab-sortinghat-1.2.1/config/settings/config_testing.py
|
||||
@@ -1,3 +1,4 @@
|
||||
+import os
|
||||
import sys
|
||||
@@ -30,11 +30,11 @@ Index: grimoirelab-sortinghat-0.19.1/config/settings/testing.py
|
||||
}
|
||||
}
|
||||
|
||||
Index: grimoirelab-sortinghat-0.19.1/config/settings/testing_tenant.py
|
||||
Index: grimoirelab-sortinghat-1.2.1/config/settings/config_testing_tenant.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-0.19.1.orig/config/settings/testing_tenant.py
|
||||
+++ grimoirelab-sortinghat-0.19.1/config/settings/testing_tenant.py
|
||||
@@ -5,8 +5,8 @@ from .testing import SQL_MODE, DATABASES
|
||||
--- grimoirelab-sortinghat-1.2.1.orig/config/settings/config_testing_tenant.py
|
||||
+++ grimoirelab-sortinghat-1.2.1/config/settings/config_testing_tenant.py
|
||||
@@ -15,8 +15,8 @@ TENANTS_DEDICATED_QUEUES = [t["name"] fo
|
||||
DATABASES.update({
|
||||
tenant: {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
@@ -45,7 +45,7 @@ Index: grimoirelab-sortinghat-0.19.1/config/settings/testing_tenant.py
|
||||
'NAME': tenant,
|
||||
'OPTIONS': {
|
||||
'charset': 'utf8mb4',
|
||||
@@ -16,9 +16,10 @@ DATABASES.update({
|
||||
@@ -26,9 +26,10 @@ DATABASES.update({
|
||||
'NAME': tenant,
|
||||
'CHARSET': 'utf8mb4',
|
||||
'COLLATION': 'utf8mb4_unicode_520_ci',
|
||||
@@ -55,5 +55,5 @@ Index: grimoirelab-sortinghat-0.19.1/config/settings/testing_tenant.py
|
||||
- 'PORT': 3306
|
||||
+ 'PORT': os.environ.get('TEST_SORTINGHAT_DB_PORT', 3306)
|
||||
}
|
||||
for tenant in ['tenant_1', 'tenant_2']
|
||||
for tenant in [t["name"] for t in tenants_cfg]
|
||||
})
|
||||
|
||||
61
no-testcontainers.patch
Normal file
61
no-testcontainers.patch
Normal file
@@ -0,0 +1,61 @@
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/runners.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/runners.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/runners.py
|
||||
@@ -18,54 +18,22 @@
|
||||
|
||||
from django.conf import settings
|
||||
from django.test.runner import DiscoverRunner
|
||||
-from testcontainers.mysql import MySqlContainer
|
||||
from unittest.suite import TestSuite
|
||||
|
||||
|
||||
-class TestContainersRunner(DiscoverRunner):
|
||||
- _mysql_container: MySqlContainer = None
|
||||
-
|
||||
- def __init__(self, *args, **kwargs):
|
||||
- super().__init__(*args, **kwargs)
|
||||
-
|
||||
- db_image = getattr(settings, "TEST_DATABASE_IMAGE", "mariadb:latest")
|
||||
-
|
||||
- self._mysql_container = MySqlContainer(image=db_image,
|
||||
- root_password="root")
|
||||
-
|
||||
- def _setup_container(self):
|
||||
- self._mysql_container.start()
|
||||
-
|
||||
- for database in settings.DATABASES:
|
||||
- settings.DATABASES[database]["HOST"] = "127.0.0.1"
|
||||
- settings.DATABASES[database]["PORT"] = self._mysql_container.get_exposed_port(3306)
|
||||
- settings.DATABASES[database]["USER"] = "root"
|
||||
- settings.DATABASES[database]["PASSWORD"] = self._mysql_container.root_password
|
||||
-
|
||||
- def _teardown_container(self):
|
||||
- self._mysql_container.stop()
|
||||
-
|
||||
- def setup_databases(self, **kwargs):
|
||||
- self._setup_container()
|
||||
- return super().setup_databases(**kwargs)
|
||||
-
|
||||
- def teardown_databases(self, old_config, **kwargs):
|
||||
- super().teardown_databases(old_config, **kwargs)
|
||||
- self._teardown_container()
|
||||
-
|
||||
|
||||
def from_tenant_module(test):
|
||||
return test.__module__.startswith('tests.tenants')
|
||||
|
||||
|
||||
-class SkipMultiTenantTestRunner(TestContainersRunner):
|
||||
+class SkipMultiTenantTestRunner(DiscoverRunner):
|
||||
def build_suite(self, test_labels=None, extra_tests=None, **kwargs):
|
||||
suite = super().build_suite(test_labels=test_labels, extra_tests=extra_tests, **kwargs)
|
||||
tests = [t for t in suite._tests if not from_tenant_module(t)]
|
||||
return TestSuite(tests=tests)
|
||||
|
||||
|
||||
-class OnlyMultiTenantTestRunner(TestContainersRunner):
|
||||
+class OnlyMultiTenantTestRunner(DiscoverRunner):
|
||||
def build_suite(self, test_labels=None, extra_tests=None, **kwargs):
|
||||
suite = super().build_suite(test_labels=test_labels, extra_tests=extra_tests, **kwargs)
|
||||
tests = [t for t in suite._tests if from_tenant_module(t)]
|
||||
@@ -1,3 +1,83 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu May 15 02:33:32 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 1.7.1:
|
||||
* New features:
|
||||
+ More detailed individual information when reviewing recommendations
|
||||
+ Renamed recommendations view labels
|
||||
+ Improved session cookie security
|
||||
+ More icons for sources
|
||||
+ Skip recommendations
|
||||
+ Sort organizations by number of enrollments
|
||||
* Bug fixes:
|
||||
+ Wrong order of affiliations
|
||||
- Add patch no-testcontainers.patch:
|
||||
* Do not rely on testcontainers to use mysql
|
||||
- Add patch support-click-8.2.patch:
|
||||
* Support click 8.2+ changes.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 11 04:53:10 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 1.5.1:
|
||||
* Update Poetry dependencies.
|
||||
- Add patch support-new-django-graphql-jwt.patch:
|
||||
* Stop calling a now removed method in new django-graphql-jwt.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Nov 9 16:00:55 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 1.5.0:
|
||||
* Mark individuals as reviewed
|
||||
Individuals can now be marked as reviewed to keep track of
|
||||
which profiles have already been checked and when. A profile can
|
||||
be marked as reviewed more than once, it will show the date
|
||||
of the last review.
|
||||
* Wrong arrong direction when merging recommendations (#934)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 7 20:49:57 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 1.4.0:
|
||||
* Less distracting main identity indicator
|
||||
* Redirect to the original URL after log in
|
||||
* Merge organizations when adding an alias
|
||||
* Customizable trusted sources for username matching
|
||||
* Users permissions migrated (#849)
|
||||
* Update workspace when identities are split (#919)
|
||||
- update to 1.3.0:
|
||||
* Remove merge recommendations (#883)
|
||||
* Merge organizations when adding an alias (#913)
|
||||
* User permissions per tenant
|
||||
* The link to an individual's GitHub profile no longer
|
||||
appears several times when there is more than one GitHub
|
||||
identity.
|
||||
* Connection closed when job is executed
|
||||
- drop add-missing-format-calls.patch (obsolete)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Aug 28 03:30:10 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 1.2.1:
|
||||
* New features:
|
||||
+ Improve loading and error indicators
|
||||
+ Save URL to an individual's LinkedIn profile
|
||||
+ Link to GitHub profile
|
||||
+ Assign users to permission groups
|
||||
+ Configuration for regular expressions in CORS
|
||||
+ Dedicated queues in multi-tenancy
|
||||
+ Organization aliases
|
||||
* Bug fixes:
|
||||
+ Consistent date format for job executions
|
||||
+ Match source parameter fixed in recommendations
|
||||
+ Organizations aliases in Python client
|
||||
+ Change password form fixed
|
||||
+ Refetch general settings after they are changed
|
||||
+ Profile view displays correct recommendations
|
||||
+ Match recommendations job fixed
|
||||
- Drop patch use-correct-assertion-methods.patch, included.
|
||||
- Refresh all other patches.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 6 04:49:48 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
@@ -81,16 +161,16 @@ Thu Jul 20 05:47:36 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
-------------------------------------------------------------------
|
||||
Sat Dec 3 00:58:41 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
|
||||
|
||||
- Update to version 0.7.23
|
||||
- Update to version 0.7.23
|
||||
* Update Poetry's package dependencies
|
||||
|
||||
- Update to version 0.7.22
|
||||
- Update to version 0.7.22
|
||||
* Update Poetry's package dependencies
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Oct 29 01:20:39 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
|
||||
|
||||
- Update to version 0.7.21
|
||||
- Update to version 0.7.21
|
||||
* Update package dependencies
|
||||
* Update jinja2 package and dev-dependencies.
|
||||
* Update Poetry's package dependencies
|
||||
@@ -99,7 +179,7 @@ Sat Oct 29 01:20:39 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 7 16:13:30 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
|
||||
|
||||
- Update to version 0.7.20
|
||||
- Update to version 0.7.20
|
||||
Bug fixes:
|
||||
* [gitdm] Skip invalid format lines
|
||||
* Gitdm parser won't fail reading files with an invalid format. Instead,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-sortinghat
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
Name: python-sortinghat
|
||||
Version: 0.19.1
|
||||
Version: 1.7.1
|
||||
Release: 0
|
||||
Summary: A tool to manage identities
|
||||
License: GPL-3.0-only
|
||||
@@ -25,23 +25,26 @@ URL: https://github.com/grimoirelab/sortinghat
|
||||
Source: https://github.com/chaoss/grimoirelab-sortinghat/archive/refs/tags/%{version}.tar.gz#/sortinghat-%{version}.tar.gz
|
||||
# PATCH-FIX-OPENSUSE Allow overridding the database config
|
||||
Patch0: allow-database-config-overrides.patch
|
||||
Patch1: add-missing-format-calls.patch
|
||||
# PATCH-FIX-UPSTREAM gh#chaoss/grimoirelab-sortinghat#855
|
||||
Patch2: use-correct-assertion-methods.patch
|
||||
# PATCH-FIX-OPENSUSE Support django-graphql-jwt 0.4.0
|
||||
Patch1: support-new-django-graphql-jwt.patch
|
||||
# PATCH-FIX-OPENSUSE Do not use testcontainers module
|
||||
Patch2: no-testcontainers.patch
|
||||
# PATCH-FIX-OPENSUSE Support click 8.2+
|
||||
Patch3: support-click-8.2.patch
|
||||
BuildRequires: %{python_module base >= 3.9}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module poetry-core}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-Django >= 3.2
|
||||
Requires: python-Django >= 4.2
|
||||
Requires: python-Jinja2 >= 3.1
|
||||
Requires: python-PyJWT
|
||||
Requires: python-PyJWT >= 2.4
|
||||
Requires: python-PyMySQL >= 0.7.0
|
||||
Requires: python-PyYAML >= 3.12
|
||||
Requires: python-SQLAlchemy >= 1.2
|
||||
Requires: python-click >= 7.1
|
||||
Requires: python-django-cors-headers >= 3.7
|
||||
Requires: python-django-cors-headers >= 4.6
|
||||
Requires: python-django-graphql-jwt >= 0.3
|
||||
Requires: python-django-rq >= 2.3
|
||||
Requires: python-django-treebeard >= 4.5
|
||||
@@ -51,23 +54,23 @@ Requires: python-grimoirelab-toolkit >= 0.3
|
||||
Requires: python-importlib-resources
|
||||
Requires: python-mysqlclient >= 2.0
|
||||
Requires: python-numpy
|
||||
Requires: python-pandas >= 1.3
|
||||
Requires: python-pandas >= 2.2
|
||||
Requires: python-python-dateutil >= 2.8.0
|
||||
Requires: python-requests >= 2.7
|
||||
Requires: python-rq
|
||||
Requires: python-setuptools
|
||||
Requires: python-sgqlc
|
||||
Requires: python-sgqlc >= 16.1
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
BuildArch: noarch
|
||||
# SECTION test requirements
|
||||
BuildRequires: %{python_module Jinja2 >= 3.1}
|
||||
BuildRequires: %{python_module Django >= 3.2}
|
||||
BuildRequires: %{python_module Django >= 4.2}
|
||||
BuildRequires: %{python_module PyMySQL >= 0.7.0}
|
||||
BuildRequires: %{python_module PyYAML >= 3.12}
|
||||
BuildRequires: %{python_module SQLAlchemy >= 1.2}
|
||||
BuildRequires: %{python_module click >= 7.1}
|
||||
BuildRequires: %{python_module django-cors-headers >= 3.7}
|
||||
BuildRequires: %{python_module django-cors-headers >= 4.6}
|
||||
BuildRequires: %{python_module django-graphql-jwt >= 0.3}
|
||||
BuildRequires: %{python_module django-rq >= 2.3}
|
||||
BuildRequires: %{python_module django-treebeard >= 4.5}
|
||||
@@ -78,12 +81,12 @@ BuildRequires: %{python_module httpretty >= 0.9.5}
|
||||
BuildRequires: %{python_module importlib-resources}
|
||||
BuildRequires: %{python_module mysqlclient >= 2.0}
|
||||
BuildRequires: %{python_module numpy}
|
||||
BuildRequires: %{python_module pandas >= 1.3}
|
||||
BuildRequires: %{python_module pandas >= 2.2}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module python-dateutil >= 2.8.0}
|
||||
BuildRequires: %{python_module requests >= 2.7}
|
||||
BuildRequires: %{python_module rq}
|
||||
BuildRequires: %{python_module sgqlc}
|
||||
BuildRequires: %{python_module sgqlc >= 16.1}
|
||||
BuildRequires: mariadb-rpm-macros
|
||||
# /SECTION
|
||||
%python_subpackages
|
||||
@@ -145,8 +148,8 @@ export TEST_SORTINGHAT_DB_USER=$user
|
||||
export TEST_SORTINGHAT_DB_PASSWORD=$pass
|
||||
# Broken tests
|
||||
rm tests/test_jobs.py
|
||||
%python_exec manage.py test --settings=config.settings.testing
|
||||
%python_exec manage.py test --settings=config.settings.testing_tenant
|
||||
%python_exec manage.py test --settings=config.settings.config_testing
|
||||
%python_exec manage.py test --settings=config.settings.config_testing_tenant
|
||||
#
|
||||
# stopping mariadb
|
||||
#
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:20ec93c4c5951bfeb2cbd5f750209eaf1aa3ab57228676c98ebc00e2f92abc05
|
||||
size 2441873
|
||||
3
sortinghat-1.7.1.tar.gz
Normal file
3
sortinghat-1.7.1.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:26e091403d3d2699d55b65a79a67494e95654bf78d66d884adff41e30f2af3ca
|
||||
size 2264700
|
||||
856
support-click-8.2.patch
Normal file
856
support-click-8.2.patch
Normal file
@@ -0,0 +1,856 @@
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_add.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/cli/test_cmd_add.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_add.py
|
||||
@@ -20,6 +20,7 @@
|
||||
# Santiago Dueñas <sduenas@bitergia.com>
|
||||
#
|
||||
|
||||
+import inspect
|
||||
import unittest
|
||||
import unittest.mock
|
||||
|
||||
@@ -107,7 +108,10 @@ class TestAddCommand(unittest.TestCase):
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Create a new identity
|
||||
params = [
|
||||
@@ -135,7 +139,10 @@ class TestAddCommand(unittest.TestCase):
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Create a new identity setting partial data
|
||||
params = [
|
||||
@@ -161,7 +168,10 @@ class TestAddCommand(unittest.TestCase):
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Assign to John Smith - a9b403e150dd4af8953a52a4bb841051e4b705d9
|
||||
# individual
|
||||
@@ -190,7 +200,11 @@ class TestAddCommand(unittest.TestCase):
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
+
|
||||
|
||||
params = [
|
||||
'--source', 'scm',
|
||||
@@ -225,7 +239,10 @@ class TestAddCommand(unittest.TestCase):
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = [
|
||||
'--source', 'scm',
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_config.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/cli/test_cmd_config.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_config.py
|
||||
@@ -20,6 +20,7 @@
|
||||
# Santiago Dueñas <sduenas@bitergia.com>
|
||||
#
|
||||
|
||||
+import inspect
|
||||
import os.path
|
||||
import shutil
|
||||
import unittest
|
||||
@@ -53,7 +54,10 @@ class TestInitConfig(unittest.TestCase):
|
||||
def test_init(self):
|
||||
"""Check if it initializes a configuration file."""
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
with runner.isolated_filesystem() as fs:
|
||||
filepath = os.path.join(fs, MOCK_CONFIG_FILE)
|
||||
@@ -79,7 +83,10 @@ class TestInitConfig(unittest.TestCase):
|
||||
def test_default_filename(self, mock_basepath):
|
||||
"""Check if it uses the default filename when filepath is not given"""
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
with runner.isolated_filesystem() as fs:
|
||||
dirpath = os.path.join(fs, '.sortinghat')
|
||||
@@ -104,7 +111,10 @@ class TestInitConfig(unittest.TestCase):
|
||||
def test_config_is_not_overwritten(self):
|
||||
"""Check whether an existing config file is not replaced"""
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
with runner.isolated_filesystem() as fs:
|
||||
shutil.copy(MOCK_CONFIG_FILEPATH, fs)
|
||||
@@ -132,7 +142,10 @@ class TestInitConfig(unittest.TestCase):
|
||||
def test_overwrite_config(self):
|
||||
"""Check whether an existing config file is overwritten"""
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
with runner.isolated_filesystem() as fs:
|
||||
shutil.copy(MOCK_CONFIG_FILEPATH, fs)
|
||||
@@ -168,7 +181,10 @@ class TestSetConfig(unittest.TestCase):
|
||||
def test_set_value(self):
|
||||
"""Check set method"""
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
with runner.isolated_filesystem() as fs:
|
||||
shutil.copy(MOCK_CONFIG_FILEPATH, fs)
|
||||
@@ -210,7 +226,10 @@ class TestSetConfig(unittest.TestCase):
|
||||
def test_default_filename(self, mock_basepath):
|
||||
"""Check if it uses the default filename when filepath is not given"""
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
with runner.isolated_filesystem() as fs:
|
||||
dirpath = os.path.join(fs, '.sortinghat')
|
||||
@@ -240,7 +259,10 @@ class TestSetConfig(unittest.TestCase):
|
||||
def test_not_available_keys(self):
|
||||
"""Check if it raises an error when the key is not available"""
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
with runner.isolated_filesystem() as fs:
|
||||
shutil.copy(MOCK_CONFIG_FILEPATH, fs)
|
||||
@@ -260,7 +282,10 @@ class TestSetConfig(unittest.TestCase):
|
||||
def test_invalid_keys(self):
|
||||
"""Check if it raises an error when the key is invalid"""
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Test keys that do not follow '<section>.<option>' schema
|
||||
with runner.isolated_filesystem() as fs:
|
||||
@@ -321,7 +346,10 @@ class TestSetConfig(unittest.TestCase):
|
||||
def test_invalid_config_files(self):
|
||||
"""Check whether it raises and error reading invalid configuration files"""
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Test keys that do not follow '<section>.<option>' schema
|
||||
with runner.isolated_filesystem() as fs:
|
||||
@@ -342,7 +370,10 @@ class TestGetConfig(unittest.TestCase):
|
||||
def test_get_value(self):
|
||||
"""Test get method"""
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
with runner.isolated_filesystem() as fs:
|
||||
shutil.copy(MOCK_CONFIG_FILEPATH, fs)
|
||||
@@ -379,7 +410,10 @@ class TestGetConfig(unittest.TestCase):
|
||||
def test_default_filename(self, mock_basepath):
|
||||
"""Check if it uses the default filename when filepath is not given"""
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
with runner.isolated_filesystem() as fs:
|
||||
mock_basepath.return_value = fs
|
||||
@@ -405,7 +439,10 @@ class TestGetConfig(unittest.TestCase):
|
||||
def test_not_available_keys(self):
|
||||
"""Check if it raises an error when the key is not available"""
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
with runner.isolated_filesystem() as fs:
|
||||
shutil.copy(MOCK_CONFIG_FILEPATH, fs)
|
||||
@@ -424,7 +461,10 @@ class TestGetConfig(unittest.TestCase):
|
||||
def test_invalid_keys(self):
|
||||
"""Check if it raises an error when the key is invalid"""
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Test keys that do not follow '<section>.<option>' schema
|
||||
with runner.isolated_filesystem() as fs:
|
||||
@@ -480,7 +520,11 @@ class TestGetConfig(unittest.TestCase):
|
||||
def test_invalid_config_files(self):
|
||||
"""Check whether it raises and error reading invalid configuration files"""
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
+
|
||||
|
||||
with runner.isolated_filesystem() as fs:
|
||||
filepath = os.path.join(fs, 'unknown_file.cfg')
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_countries.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/cli/test_cmd_countries.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_countries.py
|
||||
@@ -20,6 +20,7 @@
|
||||
# Santiago Dueñas <sduenas@bitergia.com>
|
||||
#
|
||||
|
||||
+import inspect
|
||||
import unittest
|
||||
import unittest.mock
|
||||
|
||||
@@ -135,7 +136,10 @@ class TestCountriesCommand(unittest.Test
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
result = runner.invoke(countries)
|
||||
|
||||
self.assertEqual(len(client.ops), 2)
|
||||
@@ -174,8 +178,10 @@ class TestCountriesCommand(unittest.Test
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
-
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
params = ['--code', 'ES']
|
||||
result = runner.invoke(countries, params)
|
||||
|
||||
@@ -193,7 +199,10 @@ class TestCountriesCommand(unittest.Test
|
||||
def test_countries_invalid_code(self):
|
||||
"""Check if it fails when code is invalid"""
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = ['--code', 'E']
|
||||
result = runner.invoke(countries, params)
|
||||
@@ -244,7 +253,10 @@ class TestCountriesCommand(unittest.Test
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = ['--term', 'unit']
|
||||
result = runner.invoke(countries, params)
|
||||
@@ -263,7 +275,10 @@ class TestCountriesCommand(unittest.Test
|
||||
def test_countries_invalid_term(self):
|
||||
"""Check if it fails when term is invalid"""
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = ['--term', 'E']
|
||||
result = runner.invoke(countries, params)
|
||||
@@ -304,7 +319,10 @@ class TestCountriesCommand(unittest.Test
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
result = runner.invoke(countries)
|
||||
|
||||
@@ -334,7 +352,10 @@ class TestCountriesCommand(unittest.Test
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
result = runner.invoke(countries)
|
||||
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_enroll.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/cli/test_cmd_enroll.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_enroll.py
|
||||
@@ -20,6 +20,7 @@
|
||||
# Santiago Dueñas <sduenas@bitergia.com>
|
||||
#
|
||||
|
||||
+import inspect
|
||||
import unittest
|
||||
import unittest.mock
|
||||
|
||||
@@ -93,7 +94,10 @@ class TestEnrollCommand(unittest.TestCas
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Create a new enrollment
|
||||
params = [
|
||||
@@ -124,7 +128,10 @@ class TestEnrollCommand(unittest.TestCas
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Create a new enrollment
|
||||
params = [
|
||||
@@ -151,7 +158,10 @@ class TestEnrollCommand(unittest.TestCas
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Create a new enrollment
|
||||
params = [
|
||||
@@ -180,7 +190,10 @@ class TestEnrollCommand(unittest.TestCas
|
||||
client = MockClient([])
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = [
|
||||
'322397ed782a798ffd9d0bc7e293df4292fe075d',
|
||||
@@ -225,7 +238,10 @@ class TestEnrollCommand(unittest.TestCas
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = [
|
||||
'322397ed782a798ffd9d0bc7e293df4292fe075d',
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_lock.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/cli/test_cmd_lock.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_lock.py
|
||||
@@ -20,6 +20,7 @@
|
||||
# Santiago Dueñas <sduenas@bitergia.com>
|
||||
#
|
||||
|
||||
+import inspect
|
||||
import unittest
|
||||
|
||||
import click.testing
|
||||
@@ -85,7 +86,10 @@ class TestLockAddCommand(unittest.TestCa
|
||||
]
|
||||
mock_client = MockClient(responses)
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Add lock
|
||||
params = [
|
||||
@@ -116,7 +120,10 @@ class TestLockAddCommand(unittest.TestCa
|
||||
]
|
||||
mock_client = MockClient(responses)
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = [
|
||||
'FFFFFFFFFFFFFFF'
|
||||
@@ -143,7 +150,10 @@ class TestLockRmCommand(unittest.TestCas
|
||||
]
|
||||
mock_client = MockClient(responses)
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Remove lock
|
||||
params = [
|
||||
@@ -174,7 +184,10 @@ class TestLockRmCommand(unittest.TestCas
|
||||
]
|
||||
mock_client = MockClient(responses)
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = [
|
||||
'FFFFFFFFFFFFFFF'
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_merge.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/cli/test_cmd_merge.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_merge.py
|
||||
@@ -20,6 +20,7 @@
|
||||
# Santiago Dueñas <sduenas@bitergia.com>
|
||||
#
|
||||
|
||||
+import inspect
|
||||
import unittest
|
||||
import unittest.mock
|
||||
|
||||
@@ -76,7 +77,10 @@ class TestMergeCommand(unittest.TestCase
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Merge individuals
|
||||
params = [
|
||||
@@ -113,7 +117,10 @@ class TestMergeCommand(unittest.TestCase
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = [
|
||||
'322397ed782a798ffd9d0bc7e293df4292fe075d',
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_mv.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/cli/test_cmd_mv.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_mv.py
|
||||
@@ -20,6 +20,7 @@
|
||||
# Santiago Dueñas <sduenas@bitergia.com>
|
||||
#
|
||||
|
||||
+import inspect
|
||||
import unittest
|
||||
import unittest.mock
|
||||
|
||||
@@ -86,7 +87,10 @@ class TestMvCommand(unittest.TestCase):
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Create a new identity
|
||||
params = [
|
||||
@@ -113,7 +117,10 @@ class TestMvCommand(unittest.TestCase):
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Create a new identity
|
||||
params = [
|
||||
@@ -147,7 +154,10 @@ class TestMvCommand(unittest.TestCase):
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = [
|
||||
'322397ed782a798ffd9d0bc7e293df4292fe075d',
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_profile.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/cli/test_cmd_profile.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_profile.py
|
||||
@@ -20,6 +20,7 @@
|
||||
# Santiago Dueñas <sduenas@bitergia.com>
|
||||
#
|
||||
|
||||
+import inspect
|
||||
import unittest
|
||||
import unittest.mock
|
||||
|
||||
@@ -158,7 +159,10 @@ class TestProfileCommand(unittest.TestCa
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Update the profile
|
||||
params = [
|
||||
@@ -202,7 +206,10 @@ class TestProfileCommand(unittest.TestCa
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Update the profile
|
||||
params = [
|
||||
@@ -242,7 +249,10 @@ class TestProfileCommand(unittest.TestCa
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Show the profile
|
||||
params = [
|
||||
@@ -278,7 +288,10 @@ class TestProfileCommand(unittest.TestCa
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Show the profile
|
||||
params = [
|
||||
@@ -310,7 +323,10 @@ class TestProfileCommand(unittest.TestCa
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = [
|
||||
'FFFFFFFFFFFFFFF'
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_rm.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/cli/test_cmd_rm.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_rm.py
|
||||
@@ -20,6 +20,7 @@
|
||||
# Santiago Dueñas <sduenas@bitergia.com>
|
||||
#
|
||||
|
||||
+import inspect
|
||||
import unittest
|
||||
import unittest.mock
|
||||
|
||||
@@ -86,7 +87,10 @@ class TestRmCommand(unittest.TestCase):
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Remove an individual
|
||||
params = ['eda9f62ad321b1fbe5f283cc05e2484516203117']
|
||||
@@ -116,7 +120,10 @@ class TestRmCommand(unittest.TestCase):
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Remove an identity
|
||||
params = ['eda9f62ad321b1fbe5f283cc05e2484516203117']
|
||||
@@ -146,7 +153,10 @@ class TestRmCommand(unittest.TestCase):
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = ['FFFFFFFFFFFFFFF']
|
||||
result = runner.invoke(rm, params, obj=mock_client)
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_show.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/cli/test_cmd_show.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_show.py
|
||||
@@ -20,6 +20,7 @@
|
||||
# Santiago Dueñas <sduenas@bitergia.com>
|
||||
#
|
||||
|
||||
+import inspect
|
||||
import unittest
|
||||
import unittest.mock
|
||||
|
||||
@@ -329,7 +330,11 @@ class TestShowCommand(unittest.TestCase)
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
+
|
||||
result = runner.invoke(show)
|
||||
|
||||
self.assertEqual(len(client.ops), 2)
|
||||
@@ -367,7 +372,10 @@ class TestShowCommand(unittest.TestCase)
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = ['17ab00ed3825ec2f50483e33c88df223264182ba']
|
||||
result = runner.invoke(show, params)
|
||||
@@ -401,7 +409,10 @@ class TestShowCommand(unittest.TestCase)
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
result = runner.invoke(show)
|
||||
|
||||
@@ -431,7 +442,10 @@ class TestShowCommand(unittest.TestCase)
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
result = runner.invoke(show)
|
||||
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_split.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/cli/test_cmd_split.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_split.py
|
||||
@@ -20,6 +20,7 @@
|
||||
# Santiago Dueñas <sduenas@bitergia.com>
|
||||
#
|
||||
|
||||
+import inspect
|
||||
import unittest
|
||||
import unittest.mock
|
||||
|
||||
@@ -91,7 +92,10 @@ class TestSplitCommand(unittest.TestCase
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Split into individuals
|
||||
params = uuids
|
||||
@@ -124,7 +128,10 @@ class TestSplitCommand(unittest.TestCase
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Split into individuals
|
||||
params = uuids
|
||||
@@ -157,7 +164,10 @@ class TestSplitCommand(unittest.TestCase
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = [
|
||||
'322397ed782a798ffd9d0bc7e293df4292fe075d',
|
||||
Index: grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_withdraw.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.7.1.orig/tests/cli/test_cmd_withdraw.py
|
||||
+++ grimoirelab-sortinghat-1.7.1/tests/cli/test_cmd_withdraw.py
|
||||
@@ -20,6 +20,7 @@
|
||||
# Santiago Dueñas <sduenas@bitergia.com>
|
||||
#
|
||||
|
||||
+import inspect
|
||||
import unittest
|
||||
import unittest.mock
|
||||
|
||||
@@ -92,7 +93,10 @@ class TestWithdrawCommand(unittest.TestC
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Remove enrollments
|
||||
params = [
|
||||
@@ -122,7 +126,10 @@ class TestWithdrawCommand(unittest.TestC
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner()
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
# Remove enrollments
|
||||
params = [
|
||||
@@ -145,7 +152,10 @@ class TestWithdrawCommand(unittest.TestC
|
||||
client = MockClient([])
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = [
|
||||
'322397ed782a798ffd9d0bc7e293df4292fe075d',
|
||||
@@ -190,7 +200,10 @@ class TestWithdrawCommand(unittest.TestC
|
||||
client = MockClient(responses)
|
||||
mock_client.return_value = client
|
||||
|
||||
- runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
|
||||
+ runner = click.testing.CliRunner(mix_stderr=False)
|
||||
+ else:
|
||||
+ runner = click.testing.CliRunner()
|
||||
|
||||
params = [
|
||||
'322397ed782a798ffd9d0bc7e293df4292fe075d',
|
||||
24
support-new-django-graphql-jwt.patch
Normal file
24
support-new-django-graphql-jwt.patch
Normal file
@@ -0,0 +1,24 @@
|
||||
Index: grimoirelab-sortinghat-1.5.1/sortinghat/core/middleware.py
|
||||
===================================================================
|
||||
--- grimoirelab-sortinghat-1.5.1.orig/sortinghat/core/middleware.py
|
||||
+++ grimoirelab-sortinghat-1.5.1/sortinghat/core/middleware.py
|
||||
@@ -16,7 +16,6 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django.http import Http404
|
||||
-from graphql_jwt.compat import get_operation_name
|
||||
from graphql_jwt.settings import jwt_settings
|
||||
|
||||
from . import tenant
|
||||
@@ -27,7 +26,10 @@ def allow_any(info, **kwargs):
|
||||
# "How to solve 'NoneType' object has no attribute 'fields' in
|
||||
# Graphene-django" (https://stackoverflow.com/a/71296685).
|
||||
try:
|
||||
- operation_name = get_operation_name(info.operation.operation).title()
|
||||
+ if hasattr(info.operation.operation, 'value'):
|
||||
+ operation_name = info.operation.operation.value.title()
|
||||
+ else:
|
||||
+ operation_name = info.operation.operation.title()
|
||||
operation_type = info.schema.get_type(operation_name)
|
||||
|
||||
if hasattr(operation_type, 'fields'):
|
||||
@@ -1,53 +0,0 @@
|
||||
From ad69dc80b8e8b4df49a3fe14e4a05ec31c7a67e8 Mon Sep 17 00:00:00 2001
|
||||
From: Steve Kowalik <steven@wedontsleep.org>
|
||||
Date: Tue, 6 Feb 2024 15:22:33 +1100
|
||||
Subject: [PATCH] Switch to self.assertRaisesRegex()
|
||||
|
||||
assertRaisesRegexp() is a deprecated (and as of Python 3.12, removed)
|
||||
alias of assertRaisesRegex(). Switch to it to avoid future problems.
|
||||
|
||||
Signed-off-by: Steve Kowalik <steven@wedontsleep.org>
|
||||
---
|
||||
tests/test_aux.py | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/tests/test_aux.py b/tests/test_aux.py
|
||||
index 86e421422..91a1c29c3 100644
|
||||
--- a/tests/test_aux.py
|
||||
+++ b/tests/test_aux.py
|
||||
@@ -338,7 +338,7 @@ def test_dates_out_of_bounds(self):
|
||||
|
||||
expected = DATE_OUT_OF_BOUNDS_ERROR.format(type='start',
|
||||
date=r'1800-01-01 00:00:00\+00:00')
|
||||
- with self.assertRaisesRegexp(ValueError, expected):
|
||||
+ with self.assertRaisesRegex(ValueError, expected):
|
||||
_ = [r for r in merge_datetime_ranges(dates)]
|
||||
|
||||
# Case 2
|
||||
@@ -349,7 +349,7 @@ def test_dates_out_of_bounds(self):
|
||||
|
||||
expected = DATE_OUT_OF_BOUNDS_ERROR.format(type='end',
|
||||
date=r'2100-02-01 00:00:00\+00:00')
|
||||
- with self.assertRaisesRegexp(ValueError, expected):
|
||||
+ with self.assertRaisesRegex(ValueError, expected):
|
||||
_ = [r for r in merge_datetime_ranges(dates)]
|
||||
|
||||
def test_dates_no_timezone(self):
|
||||
@@ -361,7 +361,7 @@ def test_dates_no_timezone(self):
|
||||
(datetime.datetime(1800, 1, 1, tzinfo=UTC), datetime.datetime(2010, 1, 1, tzinfo=UTC))
|
||||
]
|
||||
|
||||
- with self.assertRaisesRegexp(TypeError, CANT_COMPARE_DATES_ERROR):
|
||||
+ with self.assertRaisesRegex(TypeError, CANT_COMPARE_DATES_ERROR):
|
||||
_ = [r for r in merge_datetime_ranges(dates)]
|
||||
|
||||
# Case 2
|
||||
@@ -370,7 +370,7 @@ def test_dates_no_timezone(self):
|
||||
(datetime.datetime(1900, 1, 1, tzinfo=UTC), datetime.datetime(2010, 1, 1))
|
||||
]
|
||||
|
||||
- with self.assertRaisesRegexp(TypeError, CANT_COMPARE_DATES_ERROR):
|
||||
+ with self.assertRaisesRegex(TypeError, CANT_COMPARE_DATES_ERROR):
|
||||
_ = [r for r in merge_datetime_ranges(dates)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user