Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
c43ef144
Commit
c43ef144
authored
Oct 09, 2011
by
Éric Araujo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for Unicode handling in distutils’ check and register (#13114)
parent
8cc629dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
tests/test_check.py
tests/test_check.py
+11
-2
tests/test_register.py
tests/test_register.py
+19
-1
No files found.
tests/test_check.py
View file @
c43ef144
...
...
@@ -46,6 +46,15 @@ class CheckTestCase(support.LoggingSilencer,
cmd
=
self
.
_run
(
metadata
,
strict
=
1
)
self
.
assertEqual
(
cmd
.
_warnings
,
0
)
# now a test with non-ASCII characters
metadata
=
{
'url'
:
'xxx'
,
'author'
:
'
\
u00c9
ric'
,
'author_email'
:
'xxx'
,
'name'
:
'xxx'
,
'version'
:
'xxx'
,
'description'
:
'Something about esszet
\
u00df
'
,
'long_description'
:
'More things about esszet
\
u00df
'
}
cmd
=
self
.
_run
(
metadata
)
self
.
assertEqual
(
cmd
.
_warnings
,
0
)
def
test_check_document
(
self
):
if
not
HAS_DOCUTILS
:
# won't test without docutils
return
...
...
@@ -80,8 +89,8 @@ class CheckTestCase(support.LoggingSilencer,
self
.
assertRaises
(
DistutilsSetupError
,
self
.
_run
,
metadata
,
**
{
'strict'
:
1
,
'restructuredtext'
:
1
})
# and non-broken rest
metadata
[
'long_description'
]
=
'title
\
n
=====
\
n
\
n
test'
# and non-broken rest
, including a non-ASCII character to test #12114
metadata
[
'long_description'
]
=
'title
\
n
=====
\
n
\
n
test
\
u00df
'
cmd
=
self
.
_run
(
metadata
,
strict
=
1
,
restructuredtext
=
1
)
self
.
assertEqual
(
cmd
.
_warnings
,
0
)
...
...
tests/test_register.py
View file @
c43ef144
...
...
@@ -214,7 +214,7 @@ class RegisterTestCase(PyPIRCCommandTestCase):
# metadata are OK but long_description is broken
metadata
=
{
'url'
:
'xxx'
,
'author'
:
'xxx'
,
'author_email'
:
'
xxx
'
,
'author_email'
:
'
éxéxé
'
,
'name'
:
'xxx'
,
'version'
:
'xxx'
,
'long_description'
:
'title
\
n
==
\
n
\
n
text'
}
...
...
@@ -247,6 +247,24 @@ class RegisterTestCase(PyPIRCCommandTestCase):
finally
:
del
register_module
.
input
# and finally a Unicode test (bug #12114)
metadata
=
{
'url'
:
'xxx'
,
'author'
:
'
\
u00c9
ric'
,
'author_email'
:
'xxx'
,
'name'
:
'xxx'
,
'version'
:
'xxx'
,
'description'
:
'Something about esszet
\
u00df
'
,
'long_description'
:
'More things about esszet
\
u00df
'
}
cmd
=
self
.
_get_cmd
(
metadata
)
cmd
.
ensure_finalized
()
cmd
.
strict
=
1
inputs
=
Inputs
(
'1'
,
'tarek'
,
'y'
)
register_module
.
input
=
inputs
.
__call__
# let's run the command
try
:
cmd
.
run
()
finally
:
del
register_module
.
input
def
test_check_metadata_deprecated
(
self
):
# makes sure make_metadata is deprecated
cmd
=
self
.
_get_cmd
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment