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

Delta Between Two Patch Sets: Lib/test/test_crypt.py

Issue 16510: Using appropriate checks in tests
Left Patch Set: Created 6 years, 9 months ago
Right Patch Set: Created 5 years, 6 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Lib/test/test_copyreg.py ('k') | Lib/test/test_dbm_gnu.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 from test import support 1 from test import support
2 import unittest 2 import unittest
3 3
4 crypt = support.import_module('crypt') 4 crypt = support.import_module('crypt')
5 5
6 class CryptTestCase(unittest.TestCase): 6 class CryptTestCase(unittest.TestCase):
7 7
8 def test_crypt(self): 8 def test_crypt(self):
9 c = crypt.crypt('mypassword', 'ab') 9 c = crypt.crypt('mypassword', 'ab')
10 if support.verbose: 10 if support.verbose:
(...skipping 11 matching lines...) Expand all
22 pw = crypt.crypt('assword', method) 22 pw = crypt.crypt('assword', method)
23 self.assertEqual(len(pw), method.total_size) 23 self.assertEqual(len(pw), method.total_size)
24 pw = crypt.crypt('assword', crypt.mksalt(method)) 24 pw = crypt.crypt('assword', crypt.mksalt(method))
25 self.assertEqual(len(pw), method.total_size) 25 self.assertEqual(len(pw), method.total_size)
26 26
27 def test_methods(self): 27 def test_methods(self):
28 # Gurantee that METHOD_CRYPT is the last method in crypt.methods. 28 # Gurantee that METHOD_CRYPT is the last method in crypt.methods.
29 self.assertGreaterEqual(len(crypt.methods), 1) 29 self.assertGreaterEqual(len(crypt.methods), 1)
30 self.assertEqual(crypt.METHOD_CRYPT, crypt.methods[-1]) 30 self.assertEqual(crypt.METHOD_CRYPT, crypt.methods[-1])
31 31
32 def test_main():
33 support.run_unittest(CryptTestCase)
34
35 if __name__ == "__main__": 32 if __name__ == "__main__":
36 test_main() 33 unittest.main()
LEFTRIGHT

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