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
9eb9ea1b
Commit
9eb9ea1b
authored
Dec 15, 2013
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
074f677e
da064e60
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
13 deletions
+53
-13
setuptools/tests/environment.py
setuptools/tests/environment.py
+7
-0
setuptools/tests/test_egg_info.py
setuptools/tests/test_egg_info.py
+13
-8
setuptools/tests/test_sdist.py
setuptools/tests/test_sdist.py
+6
-1
setuptools/tests/test_svn.py
setuptools/tests/test_svn.py
+27
-4
No files found.
setuptools/tests/environment.py
View file @
9eb9ea1b
...
...
@@ -78,6 +78,9 @@ class ZippedEnvironment(unittest.TestCase):
old_cwd
=
None
def
setUp
(
self
):
if
self
.
datafile
is
None
or
self
.
dataname
is
None
:
return
if
not
os
.
path
.
isfile
(
self
.
datafile
):
self
.
old_cwd
=
None
return
...
...
@@ -98,6 +101,10 @@ class ZippedEnvironment(unittest.TestCase):
os
.
chdir
(
os
.
path
.
join
(
self
.
temp_dir
,
self
.
dataname
))
def
tearDown
(
self
):
#Assume setUp was never completed
if
self
.
dataname
is
None
or
self
.
datafile
is
None
:
return
try
:
if
self
.
old_cwd
:
os
.
chdir
(
self
.
old_cwd
)
...
...
setuptools/tests/test_egg_info.py
View file @
9eb9ea1b
...
...
@@ -8,8 +8,9 @@ import unittest
import
pkg_resources
import
warnings
from
setuptools.command
import
egg_info
from
setuptools.tests
import
environment
from
setuptools
import
svn_utils
from
setuptools.tests
import
environment
,
test_svn
from
setuptools.tests.py26compat
import
skipIf
ENTRIES_V10
=
pkg_resources
.
resource_string
(
__name__
,
'entries-v10'
)
"An entries file generated with svn 1.6.17 against the legacy Setuptools repo"
...
...
@@ -33,7 +34,8 @@ class TestEggInfo(unittest.TestCase):
entries_f
=
open
(
fn
,
'wb'
)
entries_f
.
write
(
entries
)
entries_f
.
close
()
@
skipIf
(
not
test_svn
.
_svn_check
,
"No SVN to text, in the first place"
)
def
test_version_10_format
(
self
):
"""
"""
...
...
@@ -60,11 +62,9 @@ class TestEggInfo(unittest.TestCase):
if
env
.
lower
()
==
'path'
:
path_variable
=
env
if
path_variable
is
None
:
self
.
skipTest
(
'Cannot figure out how to modify path'
)
old_path
=
os
.
environ
[
path_variable
]
os
.
environ
[
path_variable
]
=
''
if
path_variable
:
old_path
=
os
.
environ
[
path_variable
]
os
.
environ
[
path_variable
]
=
''
#catch_warnings not available until py26
warning_filters
=
warnings
.
filters
warnings
.
filters
=
warning_filters
[:]
...
...
@@ -76,7 +76,8 @@ class TestEggInfo(unittest.TestCase):
#restore the warning filters
warnings
.
filters
=
warning_filters
#restore the os path
os
.
environ
[
path_variable
]
=
old_path
if
path_variable
:
os
.
environ
[
path_variable
]
=
old_path
self
.
assertEqual
(
rev
,
'89000'
)
...
...
@@ -99,6 +100,9 @@ class TestSvnDummy(environment.ZippedEnvironment):
def
setUp
(
self
):
version
=
svn_utils
.
SvnInfo
.
get_svn_version
()
if
not
version
:
# None or Empty
return
None
self
.
base_version
=
tuple
([
int
(
x
)
for
x
in
version
.
split
(
'.'
)][:
2
])
if
not
self
.
base_version
:
...
...
@@ -114,6 +118,7 @@ class TestSvnDummy(environment.ZippedEnvironment):
'svn_data'
,
self
.
dataname
+
".zip"
)
super
(
TestSvnDummy
,
self
).
setUp
()
@
skipIf
(
not
test_svn
.
_svn_check
,
"No SVN to text, in the first place"
)
def
test_sources
(
self
):
code
,
data
=
environment
.
run_setup_py
([
"sdist"
],
pypath
=
self
.
old_cwd
,
...
...
setuptools/tests/test_sdist.py
View file @
9eb9ea1b
...
...
@@ -9,7 +9,8 @@ import tempfile
import
unittest
import
unicodedata
import
re
from
setuptools.tests
import
environment
from
setuptools.tests
import
environment
,
test_svn
from
setuptools.tests.py26compat
import
skipIf
from
setuptools.compat
import
StringIO
,
unicode
from
setuptools.tests.py26compat
import
skipIf
...
...
@@ -473,6 +474,9 @@ class TestSvn(environment.ZippedEnvironment):
def
setUp
(
self
):
version
=
svn_utils
.
SvnInfo
.
get_svn_version
()
if
not
version
:
# None or Empty
return
self
.
base_version
=
tuple
([
int
(
x
)
for
x
in
version
.
split
(
'.'
)][:
2
])
if
not
self
.
base_version
:
...
...
@@ -488,6 +492,7 @@ class TestSvn(environment.ZippedEnvironment):
'svn_data'
,
self
.
dataname
+
".zip"
)
super
(
TestSvn
,
self
).
setUp
()
@
skipIf
(
not
test_svn
.
_svn_check
,
"No SVN to text, in the first place"
)
def
test_walksvn
(
self
):
if
self
.
base_version
>=
(
1
,
6
):
folder2
=
'third party2'
...
...
setuptools/tests/test_svn.py
View file @
9eb9ea1b
...
...
@@ -3,12 +3,25 @@
import
os
import
sys
import
unittest
import
codecs
import
subprocess
from
setuptools.tests
import
environment
from
setuptools.compat
import
unicode
,
unichr
from
setuptools
import
svn_utils
from
setuptools.tests.py26compat
import
skipIf
def
_do_svn_check
():
try
:
subprocess
.
check_call
([
"svn"
,
"--version"
],
shell
=
(
sys
.
platform
==
'win32'
))
return
True
except
(
OSError
,
subprocess
.
CalledProcessError
):
return
False
_svn_check
=
_do_svn_check
()
class
TestSvnVersion
(
unittest
.
TestCase
):
...
...
@@ -20,7 +33,10 @@ class TestSvnVersion(unittest.TestCase):
path_variable
=
env
if
path_variable
is
None
:
self
.
skipTest
(
'Cannot figure out how to modify path'
)
try
:
self
.
skipTest
(
'Cannot figure out how to modify path'
)
except
AttributeError
:
# PY26 doesn't have this
return
old_path
=
os
.
environ
[
path_variable
]
os
.
environ
[
path_variable
]
=
''
...
...
@@ -30,6 +46,7 @@ class TestSvnVersion(unittest.TestCase):
finally
:
os
.
environ
[
path_variable
]
=
old_path
@
skipIf
(
not
_svn_check
,
"No SVN to text, in the first place"
)
def
test_svn_should_exist
(
self
):
version
=
svn_utils
.
SvnInfo
.
get_svn_version
()
self
.
assertNotEqual
(
version
,
''
)
...
...
@@ -169,11 +186,14 @@ class TestSvn(environment.ZippedEnvironment):
def
setUp
(
self
):
version
=
svn_utils
.
SvnInfo
.
get_svn_version
()
if
not
version
:
# empty or null
self
.
dataname
=
None
self
.
datafile
=
None
return
self
.
base_version
=
tuple
([
int
(
x
)
for
x
in
version
.
split
(
'.'
)[:
2
]])
if
not
self
.
base_version
:
raise
ValueError
(
'No SVN tools installed'
)
elif
self
.
base_version
<
(
1
,
3
):
if
self
.
base_version
<
(
1
,
3
):
raise
ValueError
(
'Insufficient SVN Version %s'
%
version
)
elif
self
.
base_version
>=
(
1
,
9
):
#trying the latest version
...
...
@@ -184,10 +204,12 @@ class TestSvn(environment.ZippedEnvironment):
'svn_data'
,
self
.
dataname
+
".zip"
)
super
(
TestSvn
,
self
).
setUp
()
@
skipIf
(
not
_svn_check
,
"No SVN to text, in the first place"
)
def
test_revision
(
self
):
rev
=
svn_utils
.
SvnInfo
.
load
(
'.'
).
get_revision
()
self
.
assertEqual
(
rev
,
6
)
@
skipIf
(
not
_svn_check
,
"No SVN to text, in the first place"
)
def
test_entries
(
self
):
expected
=
set
([
(
os
.
path
.
join
(
'a file'
),
'file'
),
...
...
@@ -200,6 +222,7 @@ class TestSvn(environment.ZippedEnvironment):
info
=
svn_utils
.
SvnInfo
.
load
(
'.'
)
self
.
assertEqual
(
set
(
x
for
x
in
info
.
entries
),
expected
)
@
skipIf
(
not
_svn_check
,
"No SVN to text, in the first place"
)
def
test_externals
(
self
):
if
self
.
base_version
>=
(
1
,
6
):
folder2
=
'third party2'
...
...
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