Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
25a23efc
Commit
25a23efc
authored
Nov 17, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19600: Use specific asserts in distutils tests.
parent
9788e860
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
36 additions
and
36 deletions
+36
-36
Lib/distutils/tests/test_archive_util.py
Lib/distutils/tests/test_archive_util.py
+1
-1
Lib/distutils/tests/test_bdist_rpm.py
Lib/distutils/tests/test_bdist_rpm.py
+2
-2
Lib/distutils/tests/test_bdist_wininst.py
Lib/distutils/tests/test_bdist_wininst.py
+1
-1
Lib/distutils/tests/test_build_clib.py
Lib/distutils/tests/test_build_clib.py
+1
-1
Lib/distutils/tests/test_build_ext.py
Lib/distutils/tests/test_build_ext.py
+7
-7
Lib/distutils/tests/test_build_scripts.py
Lib/distutils/tests/test_build_scripts.py
+4
-4
Lib/distutils/tests/test_clean.py
Lib/distutils/tests/test_clean.py
+1
-1
Lib/distutils/tests/test_config.py
Lib/distutils/tests/test_config.py
+1
-1
Lib/distutils/tests/test_config_cmd.py
Lib/distutils/tests/test_config_cmd.py
+1
-1
Lib/distutils/tests/test_install.py
Lib/distutils/tests/test_install.py
+1
-1
Lib/distutils/tests/test_install_lib.py
Lib/distutils/tests/test_install_lib.py
+2
-2
Lib/distutils/tests/test_install_scripts.py
Lib/distutils/tests/test_install_scripts.py
+5
-5
Lib/distutils/tests/test_msvc9compiler.py
Lib/distutils/tests/test_msvc9compiler.py
+3
-3
Lib/distutils/tests/test_register.py
Lib/distutils/tests/test_register.py
+4
-4
Lib/distutils/tests/test_upload.py
Lib/distutils/tests/test_upload.py
+2
-2
No files found.
Lib/distutils/tests/test_archive_util.py
View file @
25a23efc
...
@@ -199,7 +199,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
...
@@ -199,7 +199,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
dry_run
=
True
)
dry_run
=
True
)
finally
:
finally
:
os
.
chdir
(
old_dir
)
os
.
chdir
(
old_dir
)
self
.
assert
True
(
not
os
.
path
.
exists
(
tarball
))
self
.
assert
False
(
os
.
path
.
exists
(
tarball
))
self
.
assertEqual
(
len
(
w
.
warnings
),
1
)
self
.
assertEqual
(
len
(
w
.
warnings
),
1
)
@
unittest
.
skipUnless
(
zlib
,
"Requires zlib"
)
@
unittest
.
skipUnless
(
zlib
,
"Requires zlib"
)
...
...
Lib/distutils/tests/test_bdist_rpm.py
View file @
25a23efc
...
@@ -77,7 +77,7 @@ class BuildRpmTestCase(support.TempdirManager,
...
@@ -77,7 +77,7 @@ class BuildRpmTestCase(support.TempdirManager,
cmd
.
run
()
cmd
.
run
()
dist_created
=
os
.
listdir
(
os
.
path
.
join
(
pkg_dir
,
'dist'
))
dist_created
=
os
.
listdir
(
os
.
path
.
join
(
pkg_dir
,
'dist'
))
self
.
assert
True
(
'foo-0.1-1.noarch.rpm'
in
dist_created
)
self
.
assert
In
(
'foo-0.1-1.noarch.rpm'
,
dist_created
)
# bug #2945: upload ignores bdist_rpm files
# bug #2945: upload ignores bdist_rpm files
self
.
assertIn
((
'bdist_rpm'
,
'any'
,
'dist/foo-0.1-1.src.rpm'
),
dist
.
dist_files
)
self
.
assertIn
((
'bdist_rpm'
,
'any'
,
'dist/foo-0.1-1.src.rpm'
),
dist
.
dist_files
)
...
@@ -121,7 +121,7 @@ class BuildRpmTestCase(support.TempdirManager,
...
@@ -121,7 +121,7 @@ class BuildRpmTestCase(support.TempdirManager,
cmd
.
run
()
cmd
.
run
()
dist_created
=
os
.
listdir
(
os
.
path
.
join
(
pkg_dir
,
'dist'
))
dist_created
=
os
.
listdir
(
os
.
path
.
join
(
pkg_dir
,
'dist'
))
self
.
assert
True
(
'foo-0.1-1.noarch.rpm'
in
dist_created
)
self
.
assert
In
(
'foo-0.1-1.noarch.rpm'
,
dist_created
)
# bug #2945: upload ignores bdist_rpm files
# bug #2945: upload ignores bdist_rpm files
self
.
assertIn
((
'bdist_rpm'
,
'any'
,
'dist/foo-0.1-1.src.rpm'
),
dist
.
dist_files
)
self
.
assertIn
((
'bdist_rpm'
,
'any'
,
'dist/foo-0.1-1.src.rpm'
),
dist
.
dist_files
)
...
...
Lib/distutils/tests/test_bdist_wininst.py
View file @
25a23efc
...
@@ -23,7 +23,7 @@ class BuildWinInstTestCase(support.TempdirManager,
...
@@ -23,7 +23,7 @@ class BuildWinInstTestCase(support.TempdirManager,
# and make sure it finds it and returns its content
# and make sure it finds it and returns its content
# no matter what platform we have
# no matter what platform we have
exe_file
=
cmd
.
get_exe_bytes
()
exe_file
=
cmd
.
get_exe_bytes
()
self
.
assert
True
(
len
(
exe_file
)
>
10
)
self
.
assert
Greater
(
len
(
exe_file
),
10
)
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
BuildWinInstTestCase
)
return
unittest
.
makeSuite
(
BuildWinInstTestCase
)
...
...
Lib/distutils/tests/test_build_clib.py
View file @
25a23efc
...
@@ -137,7 +137,7 @@ class BuildCLibTestCase(support.TempdirManager,
...
@@ -137,7 +137,7 @@ class BuildCLibTestCase(support.TempdirManager,
cmd
.
run
()
cmd
.
run
()
# let's check the result
# let's check the result
self
.
assert
True
(
'libfoo.a'
in
os
.
listdir
(
build_temp
))
self
.
assert
In
(
'libfoo.a'
,
os
.
listdir
(
build_temp
))
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
BuildCLibTestCase
)
return
unittest
.
makeSuite
(
BuildCLibTestCase
)
...
...
Lib/distutils/tests/test_build_ext.py
View file @
25a23efc
...
@@ -80,8 +80,8 @@ class BuildExtTestCase(support.TempdirManager,
...
@@ -80,8 +80,8 @@ class BuildExtTestCase(support.TempdirManager,
if
test_support
.
HAVE_DOCSTRINGS
:
if
test_support
.
HAVE_DOCSTRINGS
:
doc
=
'This is a template module just for instruction.'
doc
=
'This is a template module just for instruction.'
self
.
assertEqual
(
xx
.
__doc__
,
doc
)
self
.
assertEqual
(
xx
.
__doc__
,
doc
)
self
.
assert
True
(
isinstance
(
xx
.
Null
(),
xx
.
Null
)
)
self
.
assert
IsInstance
(
xx
.
Null
(),
xx
.
Null
)
self
.
assert
True
(
isinstance
(
xx
.
Str
(),
xx
.
Str
)
)
self
.
assert
IsInstance
(
xx
.
Str
(),
xx
.
Str
)
def
test_solaris_enable_shared
(
self
):
def
test_solaris_enable_shared
(
self
):
dist
=
Distribution
({
'name'
:
'xx'
})
dist
=
Distribution
({
'name'
:
'xx'
})
...
@@ -102,7 +102,7 @@ class BuildExtTestCase(support.TempdirManager,
...
@@ -102,7 +102,7 @@ class BuildExtTestCase(support.TempdirManager,
_config_vars
[
'Py_ENABLE_SHARED'
]
=
old_var
_config_vars
[
'Py_ENABLE_SHARED'
]
=
old_var
# make sure we get some library dirs under solaris
# make sure we get some library dirs under solaris
self
.
assert
True
(
len
(
cmd
.
library_dirs
)
>
0
)
self
.
assert
Greater
(
len
(
cmd
.
library_dirs
),
0
)
def
test_user_site
(
self
):
def
test_user_site
(
self
):
# site.USER_SITE was introduced in 2.6
# site.USER_SITE was introduced in 2.6
...
@@ -143,10 +143,10 @@ class BuildExtTestCase(support.TempdirManager,
...
@@ -143,10 +143,10 @@ class BuildExtTestCase(support.TempdirManager,
cmd
.
finalize_options
()
cmd
.
finalize_options
()
py_include
=
sysconfig
.
get_python_inc
()
py_include
=
sysconfig
.
get_python_inc
()
self
.
assert
True
(
py_include
in
cmd
.
include_dirs
)
self
.
assert
In
(
py_include
,
cmd
.
include_dirs
)
plat_py_include
=
sysconfig
.
get_python_inc
(
plat_specific
=
1
)
plat_py_include
=
sysconfig
.
get_python_inc
(
plat_specific
=
1
)
self
.
assert
True
(
plat_py_include
in
cmd
.
include_dirs
)
self
.
assert
In
(
plat_py_include
,
cmd
.
include_dirs
)
# make sure cmd.libraries is turned into a list
# make sure cmd.libraries is turned into a list
# if it's a string
# if it's a string
...
@@ -226,13 +226,13 @@ class BuildExtTestCase(support.TempdirManager,
...
@@ -226,13 +226,13 @@ class BuildExtTestCase(support.TempdirManager,
'some'
:
'bar'
})]
'some'
:
'bar'
})]
cmd
.
check_extensions_list
(
exts
)
cmd
.
check_extensions_list
(
exts
)
ext
=
exts
[
0
]
ext
=
exts
[
0
]
self
.
assert
True
(
isinstance
(
ext
,
Extension
)
)
self
.
assert
IsInstance
(
ext
,
Extension
)
# check_extensions_list adds in ext the values passed
# check_extensions_list adds in ext the values passed
# when they are in ('include_dirs', 'library_dirs', 'libraries'
# when they are in ('include_dirs', 'library_dirs', 'libraries'
# 'extra_objects', 'extra_compile_args', 'extra_link_args')
# 'extra_objects', 'extra_compile_args', 'extra_link_args')
self
.
assertEqual
(
ext
.
libraries
,
'foo'
)
self
.
assertEqual
(
ext
.
libraries
,
'foo'
)
self
.
assert
True
(
not
hasattr
(
ext
,
'some'
))
self
.
assert
False
(
hasattr
(
ext
,
'some'
))
# 'macros' element of build info dict must be 1- or 2-tuple
# 'macros' element of build info dict must be 1- or 2-tuple
exts
=
[(
'foo.bar'
,
{
'sources'
:
[
''
],
'libraries'
:
'foo'
,
exts
=
[(
'foo.bar'
,
{
'sources'
:
[
''
],
'libraries'
:
'foo'
,
...
...
Lib/distutils/tests/test_build_scripts.py
View file @
25a23efc
...
@@ -17,8 +17,8 @@ class BuildScriptsTestCase(support.TempdirManager,
...
@@ -17,8 +17,8 @@ class BuildScriptsTestCase(support.TempdirManager,
def
test_default_settings
(
self
):
def
test_default_settings
(
self
):
cmd
=
self
.
get_build_scripts_cmd
(
"/foo/bar"
,
[])
cmd
=
self
.
get_build_scripts_cmd
(
"/foo/bar"
,
[])
self
.
assert
True
(
not
cmd
.
force
)
self
.
assert
False
(
cmd
.
force
)
self
.
assert
True
(
cmd
.
build_dir
is
None
)
self
.
assert
IsNone
(
cmd
.
build_dir
)
cmd
.
finalize_options
()
cmd
.
finalize_options
()
...
@@ -38,7 +38,7 @@ class BuildScriptsTestCase(support.TempdirManager,
...
@@ -38,7 +38,7 @@ class BuildScriptsTestCase(support.TempdirManager,
built
=
os
.
listdir
(
target
)
built
=
os
.
listdir
(
target
)
for
name
in
expected
:
for
name
in
expected
:
self
.
assert
True
(
name
in
built
)
self
.
assert
In
(
name
,
built
)
def
get_build_scripts_cmd
(
self
,
target
,
scripts
):
def
get_build_scripts_cmd
(
self
,
target
,
scripts
):
import
sys
import
sys
...
@@ -103,7 +103,7 @@ class BuildScriptsTestCase(support.TempdirManager,
...
@@ -103,7 +103,7 @@ class BuildScriptsTestCase(support.TempdirManager,
built
=
os
.
listdir
(
target
)
built
=
os
.
listdir
(
target
)
for
name
in
expected
:
for
name
in
expected
:
self
.
assert
True
(
name
in
built
)
self
.
assert
In
(
name
,
built
)
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
BuildScriptsTestCase
)
return
unittest
.
makeSuite
(
BuildScriptsTestCase
)
...
...
Lib/distutils/tests/test_clean.py
View file @
25a23efc
...
@@ -36,7 +36,7 @@ class cleanTestCase(support.TempdirManager,
...
@@ -36,7 +36,7 @@ class cleanTestCase(support.TempdirManager,
# make sure the files where removed
# make sure the files where removed
for
name
,
path
in
dirs
:
for
name
,
path
in
dirs
:
self
.
assert
True
(
not
os
.
path
.
exists
(
path
),
self
.
assert
False
(
os
.
path
.
exists
(
path
),
'%s was not removed'
%
path
)
'%s was not removed'
%
path
)
# let's run the command again (should spit warnings but succeed)
# let's run the command again (should spit warnings but succeed)
...
...
Lib/distutils/tests/test_config.py
View file @
25a23efc
...
@@ -106,7 +106,7 @@ class PyPIRCCommandTestCase(support.TempdirManager,
...
@@ -106,7 +106,7 @@ class PyPIRCCommandTestCase(support.TempdirManager,
def
test_server_empty_registration
(
self
):
def
test_server_empty_registration
(
self
):
cmd
=
self
.
_cmd
(
self
.
dist
)
cmd
=
self
.
_cmd
(
self
.
dist
)
rc
=
cmd
.
_get_rc_file
()
rc
=
cmd
.
_get_rc_file
()
self
.
assert
True
(
not
os
.
path
.
exists
(
rc
))
self
.
assert
False
(
os
.
path
.
exists
(
rc
))
cmd
.
_store_pypirc
(
'tarek'
,
'xxx'
)
cmd
.
_store_pypirc
(
'tarek'
,
'xxx'
)
self
.
assertTrue
(
os
.
path
.
exists
(
rc
))
self
.
assertTrue
(
os
.
path
.
exists
(
rc
))
f
=
open
(
rc
)
f
=
open
(
rc
)
...
...
Lib/distutils/tests/test_config_cmd.py
View file @
25a23efc
...
@@ -81,7 +81,7 @@ class ConfigTestCase(support.LoggingSilencer,
...
@@ -81,7 +81,7 @@ class ConfigTestCase(support.LoggingSilencer,
cmd
.
_clean
(
f1
,
f2
)
cmd
.
_clean
(
f1
,
f2
)
for
f
in
(
f1
,
f2
):
for
f
in
(
f1
,
f2
):
self
.
assert
True
(
not
os
.
path
.
exists
(
f
))
self
.
assert
False
(
os
.
path
.
exists
(
f
))
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
ConfigTestCase
)
return
unittest
.
makeSuite
(
ConfigTestCase
)
...
...
Lib/distutils/tests/test_install.py
View file @
25a23efc
...
@@ -237,7 +237,7 @@ class InstallTestCase(support.TempdirManager,
...
@@ -237,7 +237,7 @@ class InstallTestCase(support.TempdirManager,
self
.
test_record
()
self
.
test_record
()
finally
:
finally
:
install_module
.
DEBUG
=
False
install_module
.
DEBUG
=
False
self
.
assert
True
(
len
(
self
.
logs
)
>
old_logs_len
)
self
.
assert
Greater
(
len
(
self
.
logs
),
old_logs_len
)
def
test_suite
():
def
test_suite
():
...
...
Lib/distutils/tests/test_install_lib.py
View file @
25a23efc
...
@@ -65,7 +65,7 @@ class InstallLibTestCase(support.TempdirManager,
...
@@ -65,7 +65,7 @@ class InstallLibTestCase(support.TempdirManager,
cmd
.
distribution
.
script_name
=
'setup.py'
cmd
.
distribution
.
script_name
=
'setup.py'
# get_output should return 4 elements
# get_output should return 4 elements
self
.
assert
True
(
len
(
cmd
.
get_outputs
())
>=
2
)
self
.
assert
GreaterEqual
(
len
(
cmd
.
get_outputs
()),
2
)
def
test_get_inputs
(
self
):
def
test_get_inputs
(
self
):
pkg_dir
,
dist
=
self
.
create_dist
()
pkg_dir
,
dist
=
self
.
create_dist
()
...
@@ -98,7 +98,7 @@ class InstallLibTestCase(support.TempdirManager,
...
@@ -98,7 +98,7 @@ class InstallLibTestCase(support.TempdirManager,
finally
:
finally
:
sys
.
dont_write_bytecode
=
old_dont_write_bytecode
sys
.
dont_write_bytecode
=
old_dont_write_bytecode
self
.
assert
True
(
'byte-compiling is disabled'
in
self
.
logs
[
0
][
1
])
self
.
assert
In
(
'byte-compiling is disabled'
,
self
.
logs
[
0
][
1
])
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
InstallLibTestCase
)
return
unittest
.
makeSuite
(
InstallLibTestCase
)
...
...
Lib/distutils/tests/test_install_scripts.py
View file @
25a23efc
...
@@ -24,10 +24,10 @@ class InstallScriptsTestCase(support.TempdirManager,
...
@@ -24,10 +24,10 @@ class InstallScriptsTestCase(support.TempdirManager,
skip_build
=
1
,
skip_build
=
1
,
)
)
cmd
=
install_scripts
(
dist
)
cmd
=
install_scripts
(
dist
)
self
.
assert
True
(
not
cmd
.
force
)
self
.
assert
False
(
cmd
.
force
)
self
.
assert
True
(
not
cmd
.
skip_build
)
self
.
assert
False
(
cmd
.
skip_build
)
self
.
assert
True
(
cmd
.
build_dir
is
None
)
self
.
assert
IsNone
(
cmd
.
build_dir
)
self
.
assert
True
(
cmd
.
install_dir
is
None
)
self
.
assert
IsNone
(
cmd
.
install_dir
)
cmd
.
finalize_options
()
cmd
.
finalize_options
()
...
@@ -72,7 +72,7 @@ class InstallScriptsTestCase(support.TempdirManager,
...
@@ -72,7 +72,7 @@ class InstallScriptsTestCase(support.TempdirManager,
installed
=
os
.
listdir
(
target
)
installed
=
os
.
listdir
(
target
)
for
name
in
expected
:
for
name
in
expected
:
self
.
assert
True
(
name
in
installed
)
self
.
assert
In
(
name
,
installed
)
def
test_suite
():
def
test_suite
():
...
...
Lib/distutils/tests/test_msvc9compiler.py
View file @
25a23efc
...
@@ -128,7 +128,7 @@ class msvc9compilerTestCase(support.TempdirManager,
...
@@ -128,7 +128,7 @@ class msvc9compilerTestCase(support.TempdirManager,
# windows registeries versions.
# windows registeries versions.
path
=
r'Control Panel\
Desk
top'
path
=
r'Control Panel\
Desk
top'
v
=
Reg
.
get_value
(
path
,
u'dragfullwindows'
)
v
=
Reg
.
get_value
(
path
,
u'dragfullwindows'
)
self
.
assert
True
(
v
in
(
u'0'
,
u'1'
,
u'2'
))
self
.
assert
In
(
v
,
(
u'0'
,
u'1'
,
u'2'
))
import
_winreg
import
_winreg
HKCU
=
_winreg
.
HKEY_CURRENT_USER
HKCU
=
_winreg
.
HKEY_CURRENT_USER
...
@@ -136,7 +136,7 @@ class msvc9compilerTestCase(support.TempdirManager,
...
@@ -136,7 +136,7 @@ class msvc9compilerTestCase(support.TempdirManager,
self
.
assertEqual
(
keys
,
None
)
self
.
assertEqual
(
keys
,
None
)
keys
=
Reg
.
read_keys
(
HKCU
,
r'Control Panel'
)
keys
=
Reg
.
read_keys
(
HKCU
,
r'Control Panel'
)
self
.
assert
True
(
'Desktop'
in
keys
)
self
.
assert
In
(
'Desktop'
,
keys
)
def
test_remove_visual_c_ref
(
self
):
def
test_remove_visual_c_ref
(
self
):
from
distutils.msvc9compiler
import
MSVCCompiler
from
distutils.msvc9compiler
import
MSVCCompiler
...
@@ -174,7 +174,7 @@ class msvc9compilerTestCase(support.TempdirManager,
...
@@ -174,7 +174,7 @@ class msvc9compilerTestCase(support.TempdirManager,
compiler
=
MSVCCompiler
()
compiler
=
MSVCCompiler
()
got
=
compiler
.
_remove_visual_c_ref
(
manifest
)
got
=
compiler
.
_remove_visual_c_ref
(
manifest
)
self
.
assertIs
(
got
,
None
)
self
.
assertIs
None
(
got
)
def
test_suite
():
def
test_suite
():
...
...
Lib/distutils/tests/test_register.py
View file @
25a23efc
...
@@ -99,7 +99,7 @@ class RegisterTestCase(PyPIRCCommandTestCase):
...
@@ -99,7 +99,7 @@ class RegisterTestCase(PyPIRCCommandTestCase):
cmd
=
self
.
_get_cmd
()
cmd
=
self
.
_get_cmd
()
# we shouldn't have a .pypirc file yet
# we shouldn't have a .pypirc file yet
self
.
assert
True
(
not
os
.
path
.
exists
(
self
.
rc
))
self
.
assert
False
(
os
.
path
.
exists
(
self
.
rc
))
# patching raw_input and getpass.getpass
# patching raw_input and getpass.getpass
# so register gets happy
# so register gets happy
...
@@ -144,7 +144,7 @@ class RegisterTestCase(PyPIRCCommandTestCase):
...
@@ -144,7 +144,7 @@ class RegisterTestCase(PyPIRCCommandTestCase):
req1
=
dict
(
self
.
conn
.
reqs
[
0
].
headers
)
req1
=
dict
(
self
.
conn
.
reqs
[
0
].
headers
)
req2
=
dict
(
self
.
conn
.
reqs
[
1
].
headers
)
req2
=
dict
(
self
.
conn
.
reqs
[
1
].
headers
)
self
.
assertEqual
(
req2
[
'Content-length'
],
req1
[
'Content-length'
])
self
.
assertEqual
(
req2
[
'Content-length'
],
req1
[
'Content-length'
])
self
.
assert
True
(
'xxx'
in
self
.
conn
.
reqs
[
1
].
data
)
self
.
assert
In
(
'xxx'
,
self
.
conn
.
reqs
[
1
].
data
)
def
test_password_not_in_file
(
self
):
def
test_password_not_in_file
(
self
):
...
@@ -174,7 +174,7 @@ class RegisterTestCase(PyPIRCCommandTestCase):
...
@@ -174,7 +174,7 @@ class RegisterTestCase(PyPIRCCommandTestCase):
req
=
self
.
conn
.
reqs
[
0
]
req
=
self
.
conn
.
reqs
[
0
]
headers
=
dict
(
req
.
headers
)
headers
=
dict
(
req
.
headers
)
self
.
assertEqual
(
headers
[
'Content-length'
],
'608'
)
self
.
assertEqual
(
headers
[
'Content-length'
],
'608'
)
self
.
assert
True
(
'tarek'
in
req
.
data
)
self
.
assert
In
(
'tarek'
,
req
.
data
)
def
test_password_reset
(
self
):
def
test_password_reset
(
self
):
# this test runs choice 3
# this test runs choice 3
...
@@ -192,7 +192,7 @@ class RegisterTestCase(PyPIRCCommandTestCase):
...
@@ -192,7 +192,7 @@ class RegisterTestCase(PyPIRCCommandTestCase):
req
=
self
.
conn
.
reqs
[
0
]
req
=
self
.
conn
.
reqs
[
0
]
headers
=
dict
(
req
.
headers
)
headers
=
dict
(
req
.
headers
)
self
.
assertEqual
(
headers
[
'Content-length'
],
'290'
)
self
.
assertEqual
(
headers
[
'Content-length'
],
'290'
)
self
.
assert
True
(
'tarek'
in
req
.
data
)
self
.
assert
In
(
'tarek'
,
req
.
data
)
@
unittest
.
skipUnless
(
docutils
is
not
None
,
'needs docutils'
)
@
unittest
.
skipUnless
(
docutils
is
not
None
,
'needs docutils'
)
def
test_strict
(
self
):
def
test_strict
(
self
):
...
...
Lib/distutils/tests/test_upload.py
View file @
25a23efc
...
@@ -120,9 +120,9 @@ class uploadTestCase(PyPIRCCommandTestCase):
...
@@ -120,9 +120,9 @@ class uploadTestCase(PyPIRCCommandTestCase):
self
.
assertEqual
(
self
.
last_open
.
req
.
get_method
(),
'POST'
)
self
.
assertEqual
(
self
.
last_open
.
req
.
get_method
(),
'POST'
)
self
.
assertEqual
(
self
.
last_open
.
req
.
get_full_url
(),
self
.
assertEqual
(
self
.
last_open
.
req
.
get_full_url
(),
'http://pypi.python.org/pypi'
)
'http://pypi.python.org/pypi'
)
self
.
assert
True
(
'xxx'
in
self
.
last_open
.
req
.
data
)
self
.
assert
In
(
'xxx'
,
self
.
last_open
.
req
.
data
)
auth
=
self
.
last_open
.
req
.
headers
[
'Authorization'
]
auth
=
self
.
last_open
.
req
.
headers
[
'Authorization'
]
self
.
assert
False
(
'
\
n
'
in
auth
)
self
.
assert
NotIn
(
'
\
n
'
,
auth
)
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
uploadTestCase
)
return
unittest
.
makeSuite
(
uploadTestCase
)
...
...
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