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

Side by Side Diff: Lib/distutils/tests/test_config.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.pypirc.pypirc.""" 1 """Tests for distutils.pypirc.pypirc."""
2 import sys 2 import sys
3 import os 3 import os
4 import unittest 4 import unittest
5 import tempfile 5 import tempfile
6 6
7 from distutils.core import PyPIRCCommand 7 from distutils.core import PyPIRCCommand
8 from distutils.core import Distribution 8 from distutils.core import Distribution
9 from distutils.log import set_threshold 9 from distutils.log import set_threshold
10 from distutils.log import WARN 10 from distutils.log import WARN
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 config = cmd._read_pypirc() 96 config = cmd._read_pypirc()
97 config = list(sorted(config.items())) 97 config = list(sorted(config.items()))
98 waited = [('password', 'secret'), ('realm', 'pypi'), 98 waited = [('password', 'secret'), ('realm', 'pypi'),
99 ('repository', 'https://pypi.python.org/pypi'), 99 ('repository', 'https://pypi.python.org/pypi'),
100 ('server', 'server-login'), ('username', 'tarek')] 100 ('server', 'server-login'), ('username', 'tarek')]
101 self.assertEqual(config, waited) 101 self.assertEqual(config, waited)
102 102
103 def test_server_empty_registration(self): 103 def test_server_empty_registration(self):
104 cmd = self._cmd(self.dist) 104 cmd = self._cmd(self.dist)
105 rc = cmd._get_rc_file() 105 rc = cmd._get_rc_file()
106 self.assertTrue(not os.path.exists(rc)) 106 self.assertFalse(os.path.exists(rc))
107 cmd._store_pypirc('tarek', 'xxx') 107 cmd._store_pypirc('tarek', 'xxx')
108 self.assertTrue(os.path.exists(rc)) 108 self.assertTrue(os.path.exists(rc))
109 f = open(rc) 109 f = open(rc)
110 try: 110 try:
111 content = f.read() 111 content = f.read()
112 self.assertEqual(content, WANTED) 112 self.assertEqual(content, WANTED)
113 finally: 113 finally:
114 f.close() 114 f.close()
115 115
116 def test_suite(): 116 def test_suite():
117 return unittest.makeSuite(PyPIRCCommandTestCase) 117 return unittest.makeSuite(PyPIRCCommandTestCase)
118 118
119 if __name__ == "__main__": 119 if __name__ == "__main__":
120 run_unittest(test_suite()) 120 run_unittest(test_suite())
OLDNEW

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