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
49443195
Commit
49443195
authored
Jun 01, 2009
by
Tarek Ziadé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved distutils.dist test coverage, pep-8 compliancy
parent
c9712ebc
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
61 deletions
+103
-61
dist.py
dist.py
+52
-55
tests/test_dist.py
tests/test_dist.py
+51
-6
No files found.
dist.py
View file @
49443195
This diff is collapsed.
Click to expand it.
tests/test_dist.py
View file @
49443195
# -*- coding:
latin-1
-*-
# -*- coding:
utf8
-*-
"""Tests for distutils.dist."""
import
os
...
...
@@ -36,7 +36,9 @@ class TestDistribution(Distribution):
return
self
.
_config_files
class
DistributionTestCase
(
support
.
TempdirManager
,
unittest
.
TestCase
):
class
DistributionTestCase
(
support
.
TempdirManager
,
support
.
LoggingSilencer
,
unittest
.
TestCase
):
def
setUp
(
self
):
super
(
DistributionTestCase
,
self
).
setUp
()
...
...
@@ -106,11 +108,11 @@ class DistributionTestCase(support.TempdirManager, unittest.TestCase):
my_file
=
os
.
path
.
join
(
tmp_dir
,
'f'
)
klass
=
Distribution
dist
=
klass
(
attrs
=
{
'author'
:
u'Mister Caf'
,
dist
=
klass
(
attrs
=
{
'author'
:
u'Mister Caf
é
'
,
'name'
:
'my.package'
,
'maintainer'
:
u'Caf Junior'
,
'description'
:
u'Caf
torrfi
'
,
'long_description'
:
u'H
hh
'
})
'maintainer'
:
u'Caf
é
Junior'
,
'description'
:
u'Caf
é torréfié
'
,
'long_description'
:
u'H
éhéhé
'
})
# let's make sure the file can be written
...
...
@@ -151,6 +153,49 @@ class DistributionTestCase(support.TempdirManager, unittest.TestCase):
self
.
assertEquals
(
len
(
warns
),
0
)
def
test_finalize_options
(
self
):
attrs
=
{
'keywords'
:
'one,two'
,
'platforms'
:
'one,two'
}
dist
=
Distribution
(
attrs
=
attrs
)
dist
.
finalize_options
()
# finalize_option splits platforms and keywords
self
.
assertEquals
(
dist
.
metadata
.
platforms
,
[
'one'
,
'two'
])
self
.
assertEquals
(
dist
.
metadata
.
keywords
,
[
'one'
,
'two'
])
def
test_show_help
(
self
):
class
FancyGetopt
(
object
):
def
__init__
(
self
):
self
.
count
=
0
def
set_option_table
(
self
,
*
args
):
pass
def
print_help
(
self
,
*
args
):
self
.
count
+=
1
parser
=
FancyGetopt
()
dist
=
Distribution
()
dist
.
commands
=
[
'sdist'
]
dist
.
script_name
=
'setup.py'
dist
.
_show_help
(
parser
)
self
.
assertEquals
(
parser
.
count
,
3
)
def
test_get_command_packages
(
self
):
dist
=
Distribution
()
self
.
assertEquals
(
dist
.
command_packages
,
None
)
cmds
=
dist
.
get_command_packages
()
self
.
assertEquals
(
cmds
,
[
'distutils.command'
])
self
.
assertEquals
(
dist
.
command_packages
,
[
'distutils.command'
])
dist
.
command_packages
=
'one,two'
cmds
=
dist
.
get_command_packages
()
self
.
assertEquals
(
cmds
,
[
'distutils.command'
,
'one'
,
'two'
])
class
MetadataTestCase
(
support
.
TempdirManager
,
support
.
EnvironGuard
,
unittest
.
TestCase
):
...
...
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