Hello community, here is the log from the commit of package python-validators for openSUSE:Factory checked in at 2020-10-29 09:47:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-validators (Old) and /work/SRC/openSUSE:Factory/.python-validators.new.3463 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-validators" Thu Oct 29 09:47:23 2020 rev:14 rq:841079 version:0.18.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-validators/python-validators.changes 2020-08-25 12:38:24.421410393 +0200 +++ /work/SRC/openSUSE:Factory/.python-validators.new.3463/python-validators.changes 2020-10-29 09:47:26.736119845 +0100 @@ -1,0 +2,6 @@ +Sun Oct 11 19:05:52 UTC 2020 - Mia Herkt <m...@0x0.st> + +- Update to 0.18.1: + * Made uuid validator accept UUID objects + +------------------------------------------------------------------- Old: ---- validators-0.18.0.tar.gz New: ---- validators-0.18.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-validators.spec ++++++ --- /var/tmp/diff_new_pack.XJN5Vr/_old 2020-10-29 09:47:29.092122071 +0100 +++ /var/tmp/diff_new_pack.XJN5Vr/_new 2020-10-29 09:47:29.096122075 +0100 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-validators -Version: 0.18.0 +Version: 0.18.1 Release: 0 Summary: Python Data Validation License: MIT ++++++ validators-0.18.0.tar.gz -> validators-0.18.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/validators-0.18.0/CHANGES.rst new/validators-0.18.1/CHANGES.rst --- old/validators-0.18.0/CHANGES.rst 2020-08-19 13:27:38.000000000 +0200 +++ new/validators-0.18.1/CHANGES.rst 2020-09-03 09:36:37.000000000 +0200 @@ -2,6 +2,12 @@ --------- +0.18.1 (2020-09-03) +^^^^^^^^^^^^^^^^^^^ + +- Made uuid validator accept UUID objects (#174, pull request courtesy of Letsch22) + + 0.18.0 (2020-08-19) ^^^^^^^^^^^^^^^^^^^ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/validators-0.18.0/PKG-INFO new/validators-0.18.1/PKG-INFO --- old/validators-0.18.0/PKG-INFO 2020-08-19 13:29:45.000000000 +0200 +++ new/validators-0.18.1/PKG-INFO 2020-09-03 09:38:31.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: validators -Version: 0.18.0 +Version: 0.18.1 Summary: Python Data Validation for Humans™. Home-page: https://github.com/kvesteri/validators Author: Konsta Vesterinen diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/validators-0.18.0/tests/test_uuid.py new/validators-0.18.1/tests/test_uuid.py --- old/validators-0.18.0/tests/test_uuid.py 2015-10-10 08:47:39.000000000 +0200 +++ new/validators-0.18.1/tests/test_uuid.py 2020-09-03 09:35:41.000000000 +0200 @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +from uuid import UUID + import pytest from validators import uuid, ValidationFailure @@ -12,6 +14,13 @@ @pytest.mark.parametrize(('value',), [ + (UUID('2bc1c94f-0deb-43e9-92a1-4775189ec9f8'),), +]) +def test_returns_true_on_valid_uuid_object(value): + assert uuid(value) + + +@pytest.mark.parametrize(('value',), [ ('2bc1c94f-deb-43e9-92a1-4775189ec9f8',), ('2bc1c94f-0deb-43e9-92a1-4775189ec9f',), ('gbc1c94f-0deb-43e9-92a1-4775189ec9f8',), @@ -19,3 +28,13 @@ ]) def test_returns_failed_validation_on_invalid_mac_address(value): assert isinstance(uuid(value), ValidationFailure) + + +@pytest.mark.parametrize(('value',), [ + (1,), + (1.0,), + (True,), + (None,), +]) +def test_returns_failed_validation_on_invalid_types(value): + assert isinstance(uuid(value), ValidationFailure) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/validators-0.18.0/validators/__init__.py new/validators-0.18.1/validators/__init__.py --- old/validators-0.18.0/validators/__init__.py 2020-08-19 13:27:58.000000000 +0200 +++ new/validators-0.18.1/validators/__init__.py 2020-09-03 09:36:42.000000000 +0200 @@ -32,4 +32,4 @@ 'card_number', 'visa', 'mastercard', 'amex', 'unionpay', 'diners', 'jcb', 'discover', 'btc_address') -__version__ = '0.18.0' +__version__ = '0.18.1' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/validators-0.18.0/validators/uuid.py new/validators-0.18.1/validators/uuid.py --- old/validators-0.18.0/validators/uuid.py 2015-10-10 08:47:54.000000000 +0200 +++ new/validators-0.18.1/validators/uuid.py 2020-09-03 09:35:41.000000000 +0200 @@ -1,4 +1,7 @@ +from __future__ import absolute_import + import re +from uuid import UUID from .utils import validator @@ -28,6 +31,11 @@ .. versionadded:: 0.2 - :param value: UUID string to validate + :param value: UUID value to validate """ - return pattern.match(value) + if isinstance(value, UUID): + return True + try: + return pattern.match(value) + except TypeError: + return False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/validators-0.18.0/validators.egg-info/PKG-INFO new/validators-0.18.1/validators.egg-info/PKG-INFO --- old/validators-0.18.0/validators.egg-info/PKG-INFO 2020-08-19 13:29:45.000000000 +0200 +++ new/validators-0.18.1/validators.egg-info/PKG-INFO 2020-09-03 09:38:30.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: validators -Version: 0.18.0 +Version: 0.18.1 Summary: Python Data Validation for Humans™. Home-page: https://github.com/kvesteri/validators Author: Konsta Vesterinen