14
0

- Update to 0.12.0:

* Job scheduler
- Refresh patch add-missing-format-calls.patch.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sortinghat?expand=0&rev=38
This commit is contained in:
2023-07-27 06:09:44 +00:00
committed by Git OBS Bridge
parent 429f93355b
commit 3ba92a2f3d
5 changed files with 25 additions and 147 deletions

View File

@@ -1,7 +1,7 @@
Index: grimoirelab-sortinghat-0.11.1/tests/test_schema.py
Index: grimoirelab-sortinghat-0.12.0/tests/test_schema.py
===================================================================
--- grimoirelab-sortinghat-0.11.1.orig/tests/test_schema.py
+++ grimoirelab-sortinghat-0.11.1/tests/test_schema.py
--- grimoirelab-sortinghat-0.12.0.orig/tests/test_schema.py
+++ grimoirelab-sortinghat-0.12.0/tests/test_schema.py
@@ -22,6 +22,7 @@
#
@@ -10,7 +10,7 @@ Index: grimoirelab-sortinghat-0.11.1/tests/test_schema.py
import unittest.mock
import json
import httpretty
@@ -1401,6 +1402,7 @@ class TestQueryPagination(django.test.Te
@@ -1403,6 +1404,7 @@ class TestQueryPagination(django.test.Te
self.assertEqual(pag_data['endIndex'], 6)
self.assertEqual(pag_data['totalResults'], 6)
@@ -18,7 +18,7 @@ Index: grimoirelab-sortinghat-0.11.1/tests/test_schema.py
def test_page_size_negative(self):
"""Check if it fails when `pageSize` is a negative number"""
@@ -6341,7 +6343,8 @@ class TestAddIdentityMutation(django.tes
@@ -6343,7 +6345,8 @@ class TestAddIdentityMutation(django.tes
variables=params)
msg = executed['errors'][0]['message']
@@ -28,7 +28,7 @@ Index: grimoirelab-sortinghat-0.11.1/tests/test_schema.py
def test_add_identity_name_none(self):
"""Check if the username is set to the profile when no name is provided"""
@@ -8137,7 +8140,8 @@ class TestWithdrawMutation(django.test.T
@@ -8139,7 +8142,8 @@ class TestWithdrawMutation(django.test.T
variables=params)
msg = executed['errors'][0]['message']
@@ -38,7 +38,7 @@ Index: grimoirelab-sortinghat-0.11.1/tests/test_schema.py
def test_non_existing_organization(self):
"""Check if it fails when the organization does not exist"""
@@ -9769,6 +9773,7 @@ class TestUnifyMutation(django.test.Test
@@ -9771,6 +9775,7 @@ class TestUnifyMutation(django.test.Test
source='scm',
uuid=self.jrae.uuid)
@@ -46,7 +46,7 @@ Index: grimoirelab-sortinghat-0.11.1/tests/test_schema.py
@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"""
@@ -9840,6 +9845,7 @@ class TestUnifyMutation(django.test.Test
@@ -9842,6 +9847,7 @@ class TestUnifyMutation(django.test.Test
id5 = identities[4]
self.assertEqual(id5, self.jr2)
@@ -54,139 +54,10 @@ Index: grimoirelab-sortinghat-0.11.1/tests/test_schema.py
@unittest.mock.patch('sortinghat.core.jobs.rq.job.uuid4')
def test_unify_exclude(self, mock_job_id_gen):
"""Check if unify is applied for the specified individuals"""
Index: grimoirelab-sortinghat-0.11.1/sortinghat/core/errors.py
Index: grimoirelab-sortinghat-0.12.0/tests/cli/test_cmd_config.py
===================================================================
--- grimoirelab-sortinghat-0.11.1.orig/sortinghat/core/errors.py
+++ grimoirelab-sortinghat-0.11.1/sortinghat/core/errors.py
@@ -50,10 +50,10 @@ class BaseError(Exception):
def __init__(self, **kwargs):
super().__init__()
- self.msg = self.message % kwargs
+ self.message = self._msg % kwargs
def __str__(self):
- return self.msg
+ return self.message
def __int__(self):
return self.code
@@ -62,7 +62,7 @@ class BaseError(Exception):
class AlreadyExistsError(BaseError):
"""Exception raised when an entity already exists in the registry"""
- message = "%(entity)s '%(eid)s' already exists in the registry"
+ _msg = "%(entity)s '%(eid)s' already exists in the registry"
code = CODE_ALREADY_EXISTS_ERROR
def __init__(self, **kwargs):
@@ -74,68 +74,68 @@ class AlreadyExistsError(BaseError):
class InvalidFormatError(BaseError):
"""Exception raised when a format is invalid"""
- message = "%(cause)s"
+ _msg = "%(cause)s"
code = CODE_INVALID_FORMAT_ERROR
class LoadError(BaseError):
"""Exception raised when an error occurs loading data"""
- message = "%(cause)s"
+ _msg = "%(cause)s"
code = CODE_LOAD_ERROR
class NotFoundError(BaseError):
"""Exception raised when an entity is not found in the registry"""
- message = "%(entity)s not found in the registry"
+ _msg = "%(entity)s not found in the registry"
code = CODE_NOT_FOUND_ERROR
class InvalidValueError(BaseError):
"""Exception raised when a value is invalid"""
+ _msg = "%(msg)s"
code = CODE_VALUE_ERROR
- message = "%(msg)s"
class InvalidFilterError(BaseError):
"""Exception raised when a filter is invalid"""
+ _msg = "Error in %(filter_name)s filter: %(msg)s"
code = CODE_FILTER_ERROR
- message = "Error in %(filter_name)s filter: %(msg)s"
class EqualIndividualError(BaseError):
"""Exception raised when the source and destination individual are the same"""
+ _msg = "%(msg)s"
code = CODE_EQUAL_INDIVIDUAL_ERROR
- message = "%(msg)s"
class ClosedTransactionError(BaseError):
"""Exception raised when performing a change on a closed transaction"""
+ _msg = "%(msg)s"
code = CODE_CLOSED_TRANSACTION_ERROR
- message = "%(msg)s"
class LockedIdentityError(BaseError):
"""Exception raised when performing a change on a locked individual"""
+ _msg = "Individual %(uuid)s is locked"
code = CODE_LOCKED_IDENTITY_ERROR
- message = "Individual %(uuid)s is locked"
class DuplicateRangeError(BaseError):
"""Exception raised when setting an enrollment with an existing date range"""
+ _msg = "range date '%(start)s'-'%(end)s' is part of an existing range for %(group)s"
code = CODE_DUPLICATE_RANGE_ERROR
- message = "range date '%(start)s'-'%(end)s' is part of an existing range for %(group)s"
class RecommendationEngineError(BaseError):
"""Exception raised when there is an error in the recommendation engine"""
+ _msg = "%(msg)s"
code = CODE_RECOMMENDATION_ERROR
- message = "%(msg)s"
Index: grimoirelab-sortinghat-0.11.1/tests/test_errors.py
===================================================================
--- grimoirelab-sortinghat-0.11.1.orig/tests/test_errors.py
+++ grimoirelab-sortinghat-0.11.1/tests/test_errors.py
@@ -39,16 +39,16 @@ from sortinghat.core.errors import (Base
# Mock classes to test BaseError class
class MockCode(BaseError):
- message = "Mock error with code"
+ _msg = "Mock error with code"
code = 9314
class MockErrorNoArgs(BaseError):
- message = "Mock error without args"
+ _msg = "Mock error without args"
class MockErrorArgs(BaseError):
- message = "Mock error with args. Error: %(code)s %(msg)s"
+ _msg = "Mock error with args. Error: %(code)s %(msg)s"
class TestBaseError(TestCase):
Index: grimoirelab-sortinghat-0.11.1/tests/cli/test_cmd_config.py
===================================================================
--- grimoirelab-sortinghat-0.11.1.orig/tests/cli/test_cmd_config.py
+++ grimoirelab-sortinghat-0.11.1/tests/cli/test_cmd_config.py
--- grimoirelab-sortinghat-0.12.0.orig/tests/cli/test_cmd_config.py
+++ grimoirelab-sortinghat-0.12.0/tests/cli/test_cmd_config.py
@@ -41,10 +41,10 @@ MOCK_CONFIG_FILEPATH = os.path.join(os.p
@@ -200,10 +71,10 @@ Index: grimoirelab-sortinghat-0.11.1/tests/cli/test_cmd_config.py
class TestInitConfig(unittest.TestCase):
Index: grimoirelab-sortinghat-0.11.1/sortinghat/core/decorators.py
Index: grimoirelab-sortinghat-0.12.0/sortinghat/core/decorators.py
===================================================================
--- grimoirelab-sortinghat-0.11.1.orig/sortinghat/core/decorators.py
+++ grimoirelab-sortinghat-0.11.1/sortinghat/core/decorators.py
--- grimoirelab-sortinghat-0.12.0.orig/sortinghat/core/decorators.py
+++ grimoirelab-sortinghat-0.12.0/sortinghat/core/decorators.py
@@ -44,6 +44,8 @@ check_auth = user_passes_test(