@@ -13,6 +13,7 @@ class CreateTestCase(support.TempdirManager,
1313 support .EnvironRestorer ,
1414 unittest .TestCase ):
1515
16+ maxDiff = None
1617 restore_environ = ['PLAT' ]
1718
1819 def setUp (self ):
@@ -65,10 +66,15 @@ def test_find_files(self):
6566 # building the structure
6667 tempdir = self .wdir
6768 dirs = ['pkg1' , 'data' , 'pkg2' , 'pkg2/sub' ]
68- files = ['README' , 'setup.cfg' , 'foo.py' ,
69- 'pkg1/__init__.py' , 'pkg1/bar.py' ,
70- 'data/data1' , 'pkg2/__init__.py' ,
71- 'pkg2/sub/__init__.py' ]
69+ files = [
70+ 'README' ,
71+ 'data/data1' ,
72+ 'foo.py' ,
73+ 'pkg1/__init__.py' ,
74+ 'pkg1/bar.py' ,
75+ 'pkg2/__init__.py' ,
76+ 'pkg2/sub/__init__.py' ,
77+ ]
7278
7379 for dir_ in dirs :
7480 os .mkdir (os .path .join (tempdir , dir_ ))
@@ -85,8 +91,8 @@ def test_find_files(self):
8591 ['pkg1' , 'pkg2' , 'pkg2.sub' ])
8692 self .assertEqual (mainprogram .data ['modules' ], ['foo' ])
8793 data_fn = os .path .join ('data' , 'data1' )
88- self .assertEqual (set ( mainprogram .data ['extra_files' ]) ,
89- set ([ 'setup.cfg' , ' README' , data_fn ]) )
94+ self .assertEqual (mainprogram .data ['extra_files' ],
95+ [ ' README' , data_fn ])
9096
9197 def test_convert_setup_py_to_cfg (self ):
9298 self .write_file ((self .wdir , 'setup.py' ),
@@ -130,43 +136,45 @@ def test_convert_setup_py_to_cfg(self):
130136 main ()
131137
132138 with open (os .path .join (self .wdir , 'setup.cfg' ), encoding = 'utf-8' ) as fp :
133- lines = set (line .rstrip () for line in fp )
134-
135- # FIXME don't use sets
136- self .assertEqual (lines , set (['' ,
137- '[metadata]' ,
138- 'version = 0.2' ,
139- 'name = pyxfoil' ,
140- 'maintainer = André Espaze' ,
141- 'description = My super Death-scription' ,
142- ' |barbar is now on the public domain,' ,
143- ' |ho, baby !' ,
144- 'maintainer_email = [email protected] ' ,
145- 'home_page = http://www.python-science.org/project/pyxfoil' ,
146- 'download_url = UNKNOWN' ,
147- 'summary = Python bindings for the Xfoil engine' ,
148- '[files]' ,
149- 'modules = my_lib' ,
150- ' mymodule' ,
151- 'packages = pyxfoil' ,
152- ' babar' ,
153- ' me' ,
154- 'extra_files = Martinique/Lamentin/dady' ,
155- ' Martinique/Lamentin/mumy' ,
156- ' Martinique/Lamentin/sys' ,
157- ' Martinique/Lamentin/bro' ,
158- ' Pom' ,
159- ' Flora' ,
160- ' Alexander' ,
161- ' setup.py' ,
162- ' README' ,
163- ' pyxfoil/fengine.so' ,
164- 'scripts = my_script' ,
165- ' bin/run' ,
166- 'resources =' ,
167- ' README.rst = {doc}' ,
168- ' pyxfoil.1 = {man}' ,
169- ]))
139+ contents = fp .read ()
140+
141+ self .assertEqual (contents , dedent ("""\
142+ [metadata]
143+ name = pyxfoil
144+ version = 0.2
145+ summary = Python bindings for the Xfoil engine
146+ download_url = UNKNOWN
147+ home_page = http://www.python-science.org/project/pyxfoil
148+ maintainer = André Espaze
149+ maintainer_email = [email protected] 150+ description = My super Death-scription
151+ |barbar is now on the public domain,
152+ |ho, baby !
153+
154+ [files]
155+ packages = pyxfoil
156+ babar
157+ me
158+ modules = my_lib
159+ mymodule
160+ scripts = my_script
161+ bin/run
162+ extra_files = Martinique/Lamentin/dady
163+ Martinique/Lamentin/mumy
164+ Martinique/Lamentin/sys
165+ Martinique/Lamentin/bro
166+ setup.py
167+ README
168+ Pom
169+ Flora
170+ Alexander
171+ pyxfoil/fengine.so
172+
173+ resources =
174+ README.rst = {doc}
175+ pyxfoil.1 = {man}
176+
177+ """ ))
170178
171179 def test_convert_setup_py_to_cfg_with_description_in_readme (self ):
172180 self .write_file ((self .wdir , 'setup.py' ),
@@ -203,26 +211,29 @@ def test_convert_setup_py_to_cfg_with_description_in_readme(self):
203211 # FIXME Out of memory error.
204212 main ()
205213 with open (os .path .join (self .wdir , 'setup.cfg' ), encoding = 'utf-8' ) as fp :
206- lines = set (line .rstrip () for line in fp )
207-
208- self .assertEqual (lines , set (['' ,
209- '[metadata]' ,
210- 'version = 0.2' ,
211- 'name = pyxfoil' ,
212- 'maintainer = André Espaze' ,
213- 'maintainer_email = [email protected] ' ,
214- 'home_page = http://www.python-science.org/project/pyxfoil' ,
215- 'download_url = UNKNOWN' ,
216- 'summary = Python bindings for the Xfoil engine' ,
217- 'description-file = README.txt' ,
218- '[files]' ,
219- 'packages = pyxfoil' ,
220- 'extra_files = pyxfoil/fengine.so' ,
221- ' pyxfoil/babar.so' ,
222- 'resources =' ,
223- ' README.rst = {doc}' ,
224- ' pyxfoil.1 = {man}' ,
225- ]))
214+ contents = fp .read ()
215+
216+ self .assertEqual (contents , dedent ("""\
217+ [metadata]
218+ name = pyxfoil
219+ version = 0.2
220+ summary = Python bindings for the Xfoil engine
221+ download_url = UNKNOWN
222+ home_page = http://www.python-science.org/project/pyxfoil
223+ maintainer = André Espaze
224+ maintainer_email = [email protected] 225+ description-file = README.txt
226+
227+ [files]
228+ packages = pyxfoil
229+ extra_files = pyxfoil/fengine.so
230+ pyxfoil/babar.so
231+
232+ resources =
233+ README.rst = {doc}
234+ pyxfoil.1 = {man}
235+
236+ """ ))
226237
227238
228239def test_suite ():
0 commit comments