fix the tests error
This commit is contained in:
parent
167270e55d
commit
5d68afcb6b
22
fix-the-ImportManger-infinite-recursion.patch
Normal file
22
fix-the-ImportManger-infinite-recursion.patch
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
From 18219344a05a2db8aaa39f401567d18b9ffd57c6 Mon Sep 17 00:00:00 2001
|
||||||
|
Subject: fix the ImportManger infinite recursion
|
||||||
|
|
||||||
|
---
|
||||||
|
Cheetah/ImportManager.py | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/Cheetah/ImportManager.py b/Cheetah/ImportManager.py
|
||||||
|
index dbb2c96..d752755 100644
|
||||||
|
--- a/Cheetah/ImportManager.py
|
||||||
|
+++ b/Cheetah/ImportManager.py
|
||||||
|
@@ -21,6 +21,7 @@ import sys
|
||||||
|
import imp
|
||||||
|
import marshal
|
||||||
|
from Cheetah.compat import string_type
|
||||||
|
+import _bootlocale
|
||||||
|
|
||||||
|
_installed = False
|
||||||
|
|
||||||
|
--
|
||||||
|
2.23.0
|
||||||
|
|
||||||
45
fix-the-regressions-test-error.patch
Normal file
45
fix-the-regressions-test-error.patch
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
From 43de6576d55bfcbdbc51e065f5df78fb8da83023 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Oleg Broytman <phd@phdru.name>
|
||||||
|
Date: Sat, 6 Apr 2019 17:25:30 +0300
|
||||||
|
Subject: [PATCH] Tests: Use `cgi.escape` for Py2, `html.escape` for Py3
|
||||||
|
|
||||||
|
---
|
||||||
|
Cheetah/Tests/Regressions.py | 11 +++++++----
|
||||||
|
1 files changed, 7 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/Cheetah/Tests/Regressions.py b/Cheetah/Tests/Regressions.py
|
||||||
|
index b380e6d..b72fd77 100755
|
||||||
|
--- a/Cheetah/Tests/Regressions.py
|
||||||
|
+++ b/Cheetah/Tests/Regressions.py
|
||||||
|
@@ -1,5 +1,10 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
+try:
|
||||||
|
+ from cgi import escape as html_escape
|
||||||
|
+except ImportError: # Python 3.8+
|
||||||
|
+ from html import escape as html_escape
|
||||||
|
+
|
||||||
|
import unittest
|
||||||
|
import Cheetah.NameMapper
|
||||||
|
import Cheetah.Template
|
||||||
|
@@ -138,18 +143,16 @@ class Mantis_Issue_11_Regression_Test(unittest.TestCase):
|
||||||
|
s = s.replace("&", "&") # Must be done first!
|
||||||
|
'''
|
||||||
|
def test_FailingBehavior(self):
|
||||||
|
- import cgi
|
||||||
|
template = Cheetah.Template.Template(
|
||||||
|
"$escape($request)",
|
||||||
|
- searchList=[{'escape': cgi.escape, 'request': 'foobar'}])
|
||||||
|
+ searchList=[{'escape': html_escape, 'request': 'foobar'}])
|
||||||
|
assert template
|
||||||
|
self.assertRaises(AttributeError, template.respond)
|
||||||
|
|
||||||
|
def test_FailingBehaviorWithSetting(self):
|
||||||
|
- import cgi
|
||||||
|
template = Cheetah.Template.Template(
|
||||||
|
"$escape($request)",
|
||||||
|
- searchList=[{'escape': cgi.escape, 'request': 'foobar'}],
|
||||||
|
+ searchList=[{'escape': html_escape, 'request': 'foobar'}],
|
||||||
|
compilerSettings={'prioritizeSearchListOverSelf': True})
|
||||||
|
assert template
|
||||||
|
assert template.respond()
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: python-cheetah
|
Name: python-cheetah
|
||||||
Version: 3.1.0
|
Version: 3.1.0
|
||||||
Release: 7
|
Release: 8
|
||||||
Summary: The Python-Powered Template Engine
|
Summary: The Python-Powered Template Engine
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: http://cheetahtemplate.org/
|
URL: http://cheetahtemplate.org/
|
||||||
@ -9,6 +9,8 @@ BuildRequires: gcc python2-devel python2-setuptools python2-markdown python2-py
|
|||||||
BuildRequires: python3-devel python3-setuptools python3-markdown python3-pygments
|
BuildRequires: python3-devel python3-setuptools python3-markdown python3-pygments
|
||||||
|
|
||||||
Patch0001: cheetah-3.0.0-dont-run-tests-twice.patch
|
Patch0001: cheetah-3.0.0-dont-run-tests-twice.patch
|
||||||
|
Patch0002: fix-the-regressions-test-error.patch
|
||||||
|
Patch0003: fix-the-ImportManger-infinite-recursion.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Cheetah3 is a free and open source template engine and code-generation tool written in Python.
|
Cheetah3 is a free and open source template engine and code-generation tool written in Python.
|
||||||
@ -65,5 +67,8 @@ export PATH="%{buildroot}/%{_bindir}:$PATH" PYTHONPATH="%{buildroot}/%{python3_s
|
|||||||
%{python3_sitearch}/
|
%{python3_sitearch}/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jun 24 2020 wangchong <wangchong56@huawei.com> - 3.1.0-8
|
||||||
|
- fix the tests error
|
||||||
|
|
||||||
* Wed Jan 8 2020 liujing<liujing144@huawei.com> - 3.1.0-7
|
* Wed Jan 8 2020 liujing<liujing144@huawei.com> - 3.1.0-7
|
||||||
- Package init
|
- Package init
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user