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
540edc6e
Commit
540edc6e
authored
Aug 20, 2011
by
Éric Araujo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for extension modules in the old-style record file
parent
746e72d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
Lib/packaging/tests/test_command_install_dist.py
Lib/packaging/tests/test_command_install_dist.py
+24
-1
No files found.
Lib/packaging/tests/test_command_install_dist.py
View file @
540edc6e
...
...
@@ -6,6 +6,7 @@ from sysconfig import (get_scheme_names, get_config_vars,
_SCHEMES
,
get_config_var
,
get_path
)
from
packaging.command.install_dist
import
install_dist
from
packaging.compiler.extension
import
Extension
from
packaging.dist
import
Distribution
from
packaging.errors
import
PackagingOptionError
...
...
@@ -176,7 +177,6 @@ class InstallTestCase(support.TempdirManager,
# test pre-PEP 376 --record option (outside dist-info dir)
install_dir
=
self
.
mkdtemp
()
project_dir
,
dist
=
self
.
create_dist
(
scripts
=
[
'hello'
])
#self.addCleanup(os.chdir, os.getcwd())
os
.
chdir
(
project_dir
)
self
.
write_file
(
'hello'
,
"print('o hai')"
)
...
...
@@ -197,6 +197,29 @@ class InstallTestCase(support.TempdirManager,
# XXX test that fancy_getopt is okay with options named
# record and no-record but unrelated
def
test_old_record_extensions
(
self
):
# test pre-PEP 376 --record option with ext modules
install_dir
=
self
.
mkdtemp
()
project_dir
,
dist
=
self
.
create_dist
(
ext_modules
=
[
Extension
(
'xx'
,
[
'xxmodule.c'
])])
os
.
chdir
(
project_dir
)
support
.
copy_xxmodule_c
(
project_dir
)
cmd
=
install_dist
(
dist
)
dist
.
command_obj
[
'install_dist'
]
=
cmd
cmd
.
root
=
install_dir
cmd
.
record
=
os
.
path
.
join
(
project_dir
,
'filelist'
)
cmd
.
ensure_finalized
()
cmd
.
run
()
with
open
(
cmd
.
record
)
as
f
:
content
=
f
.
read
()
found
=
[
os
.
path
.
basename
(
line
)
for
line
in
content
.
splitlines
()]
expected
=
[
'xx%s'
%
get_config_var
(
'SO'
),
'METADATA'
,
'INSTALLER'
,
'REQUESTED'
,
'RECORD'
]
self
.
assertEqual
(
found
,
expected
)
def
test_suite
():
return
unittest
.
makeSuite
(
InstallTestCase
)
...
...
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