Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(28252)

Side by Side Diff: Lib/distutils/tests/test_bdist_rpm.py

Issue 19600: Use specific asserts in distutils tests
Patch Set: Created 5 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 """Tests for distutils.command.bdist_rpm.""" 1 """Tests for distutils.command.bdist_rpm."""
2 2
3 import unittest 3 import unittest
4 import sys 4 import sys
5 import os 5 import os
6 import tempfile 6 import tempfile
7 import shutil 7 import shutil
8 from test.support import run_unittest 8 from test.support import run_unittest
9 9
10 from distutils.core import Distribution 10 from distutils.core import Distribution
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 sys.argv = ['setup.py'] 74 sys.argv = ['setup.py']
75 cmd = bdist_rpm(dist) 75 cmd = bdist_rpm(dist)
76 cmd.fix_python = True 76 cmd.fix_python = True
77 77
78 # running in quiet mode 78 # running in quiet mode
79 cmd.quiet = 1 79 cmd.quiet = 1
80 cmd.ensure_finalized() 80 cmd.ensure_finalized()
81 cmd.run() 81 cmd.run()
82 82
83 dist_created = os.listdir(os.path.join(pkg_dir, 'dist')) 83 dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
84 self.assertTrue('foo-0.1-1.noarch.rpm' in dist_created) 84 self.assertIn('foo-0.1-1.noarch.rpm', dist_created)
85 85
86 # bug #2945: upload ignores bdist_rpm files 86 # bug #2945: upload ignores bdist_rpm files
87 self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_ files) 87 self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_ files)
88 self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.di st_files) 88 self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.di st_files)
89 89
90 def test_no_optimize_flag(self): 90 def test_no_optimize_flag(self):
91 91
92 # XXX I am unable yet to make this test work without 92 # XXX I am unable yet to make this test work without
93 # spurious sdtout/stderr output under Mac OS X 93 # spurious sdtout/stderr output under Mac OS X
94 if not sys.platform.startswith('linux'): 94 if not sys.platform.startswith('linux'):
(...skipping 23 matching lines...) Expand all
118 118
119 sys.argv = ['setup.py'] 119 sys.argv = ['setup.py']
120 cmd = bdist_rpm(dist) 120 cmd = bdist_rpm(dist)
121 cmd.fix_python = True 121 cmd.fix_python = True
122 122
123 cmd.quiet = 1 123 cmd.quiet = 1
124 cmd.ensure_finalized() 124 cmd.ensure_finalized()
125 cmd.run() 125 cmd.run()
126 126
127 dist_created = os.listdir(os.path.join(pkg_dir, 'dist')) 127 dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
128 self.assertTrue('foo-0.1-1.noarch.rpm' in dist_created) 128 self.assertIn('foo-0.1-1.noarch.rpm', dist_created)
129 129
130 # bug #2945: upload ignores bdist_rpm files 130 # bug #2945: upload ignores bdist_rpm files
131 self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_ files) 131 self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_ files)
132 self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.di st_files) 132 self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.di st_files)
133 133
134 os.remove(os.path.join(pkg_dir, 'dist', 'foo-0.1-1.noarch.rpm')) 134 os.remove(os.path.join(pkg_dir, 'dist', 'foo-0.1-1.noarch.rpm'))
135 135
136 def test_suite(): 136 def test_suite():
137 return unittest.makeSuite(BuildRpmTestCase) 137 return unittest.makeSuite(BuildRpmTestCase)
138 138
139 if __name__ == '__main__': 139 if __name__ == '__main__':
140 run_unittest(test_suite()) 140 run_unittest(test_suite())
OLDNEW

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+