15
0

- Add 767-skip-xc20p-tests.patch to skip unavailable tests

(gh#authlib/authlib#456).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Authlib?expand=0&rev=47
This commit is contained in:
2025-05-02 21:30:36 +00:00
committed by Git OBS Bridge
parent 8e56f7f750
commit e6b3001848
3 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
From 8f823db3fe552b8337cce1eb4ec4207411c63d0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89loi=20Rivard?= <eloi@yaal.coop>
Date: Thu, 1 May 2025 10:04:21 +0200
Subject: [PATCH] fix: skip xc20p unit tests when unavailable in cryptodome
---
tests/jose/test_chacha20.py | 6 ++++++
1 file changed, 6 insertions(+)
Index: authlib-1.5.2/tests/jose/test_chacha20.py
===================================================================
--- authlib-1.5.2.orig/tests/jose/test_chacha20.py 2025-04-02 12:30:25.000000000 +0200
+++ authlib-1.5.2/tests/jose/test_chacha20.py 2025-05-02 18:21:41.958090585 +0200
@@ -1,5 +1,7 @@
import unittest
+import pytest
+
from authlib.jose import JsonWebEncryption
from authlib.jose import OctKey
from authlib.jose.drafts import register_jwe_draft
@@ -22,6 +24,8 @@
self.assertRaises(ValueError, jwe.serialize_compact, protected, b"hello", key2)
def test_dir_alg_xc20p(self):
+ pytest.importorskip("Cryptodome.Cipher.ChaCha20_Poly1305")
+
jwe = JsonWebEncryption()
key = OctKey.generate_key(256, is_private=True)
protected = {"alg": "dir", "enc": "XC20P"}
@@ -35,6 +39,8 @@
self.assertRaises(ValueError, jwe.serialize_compact, protected, b"hello", key2)
def test_xc20p_content_encryption_decryption(self):
+ pytest.importorskip("Cryptodome.Cipher.ChaCha20_Poly1305")
+
# https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha-03#appendix-A.3.1
enc = JsonWebEncryption.ENC_REGISTRY["XC20P"]

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri May 2 21:29:54 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Add 767-skip-xc20p-tests.patch to skip unavailable tests
(gh#authlib/authlib#456).
-------------------------------------------------------------------
Wed Apr 23 10:49:33 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>

View File

@@ -25,6 +25,9 @@ Summary: Python library for building OAuth and OpenID Connect servers
License: BSD-3-Clause
URL: https://authlib.org/
Source: https://github.com/lepture/%{modname}/archive/refs/tags/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM 767-skip-xc20p-tests.patch bsc#[0-9]+ mcepl@suse.com
# skip unavailable tests
Patch0: 767-skip-xc20p-tests.patch
BuildRequires: %{python_module base >= 3.9}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
@@ -74,6 +77,7 @@ $python -mpytest tests/core
$python -mpytest tests/flask
# gh#lepture/authlib#456
$python -mpytest tests/jose -k 'not (test_dir_alg_xc20p or test_xc20p_content_encryption_decryption)'
# $python -mpytest tests/jose
export DJANGO_SETTINGS_MODULE=tests.clients.test_django.settings
$python -mpytest tests/clients
# export DJANGO_SETTINGS_MODULE=tests.django.settings