コード例 #1
0
ファイル: tools_tests.py プロジェクト: magul/pywikibot-core
 def test_sha1_complete_calculation(self):
     """Test sha1 of complete file."""
     res = tools.compute_file_hash(self.filename, sha='sha1')
     self.assertIn(res, (
         '1c12696e1119493a625aa818a35c41916ce32d0c',
         '146121e6d0461916c9a0fab00dc718acdb6a6b14',
     ))
コード例 #2
0
 def test_sha224_complete_calculation(self):
     """Test sha224 of complete file."""
     res = tools.compute_file_hash(self.filename, sha='sha224')
     self.assertIn(res, (
         '3d350d9d9eca074bd299cb5ffe1b325a9f589b2bcd7ba1c033ab4d33',
         '4a2cf33b7da01f7b0530b2cc624e1180c8651b20198e9387aee0c767',
     ))
コード例 #3
0
ファイル: tools_tests.py プロジェクト: magul/pywikibot-core
 def test_md5_complete_calculation(self):
     """Test md5 of complete file."""
     res = tools.compute_file_hash(self.filename, sha='md5')
     self.assertIn(res, (
         '5d7265e290e6733e1e2020630262a6f3',
         '2c941f2fa7e6e629d165708eb02b67f7',
     ))
コード例 #4
0
 def test_sha1_complete_calculation(self):
     """Test sha1 of complete file."""
     res = tools.compute_file_hash(self.filename, sha='sha1')
     self.assertIn(res, (
         '1c12696e1119493a625aa818a35c41916ce32d0c',
         '146121e6d0461916c9a0fab00dc718acdb6a6b14',
     ))
コード例 #5
0
 def test_sha224_partial_calculation(self):
     """"Test sha224 of partial file (1024 bytes)."""
     res = tools.compute_file_hash(self.filename,
                                   sha='sha224',
                                   bytes_to_read=1024)
     self.assertEqual(
         res, 'affa8cb79656a9b6244a079f8af91c9271e382aa9d5aa412b599e169')
コード例 #6
0
 def test_md5_complete_calculation(self):
     """Test md5 of complete file."""
     res = tools.compute_file_hash(self.filename, sha='md5')
     self.assertIn(res, (
         '5d7265e290e6733e1e2020630262a6f3',
         '2c941f2fa7e6e629d165708eb02b67f7',
     ))
コード例 #7
0
ファイル: tools_tests.py プロジェクト: magul/pywikibot-core
 def test_sha224_complete_calculation(self):
     """Test sha224 of complete file."""
     res = tools.compute_file_hash(self.filename, sha='sha224')
     self.assertIn(res, (
         '3d350d9d9eca074bd299cb5ffe1b325a9f589b2bcd7ba1c033ab4d33',
         '4a2cf33b7da01f7b0530b2cc624e1180c8651b20198e9387aee0c767',
     ))
コード例 #8
0
ファイル: tools_tests.py プロジェクト: magul/pywikibot-core
 def test_md5_partial_calculation(self):
     """Test md5 of partial file (1024 bytes)."""
     res = tools.compute_file_hash(self.filename, sha='md5',
                                   bytes_to_read=1024)
     self.assertIn(res, (
         'edf6e1accead082b6b831a0a600704bc',
         'be0227b6d490baa49e6d7e131c7f596b',
     ))
コード例 #9
0
 def test_sha224_partial_calculation(self):
     """Test sha224 of partial file (1024 bytes)."""
     res = tools.compute_file_hash(self.filename, sha='sha224',
                                   bytes_to_read=1024)
     self.assertIn(res, (
         'affa8cb79656a9b6244a079f8af91c9271e382aa9d5aa412b599e169',
         '486467144e683aefd420d576250c4cc984e6d7bf10c85d36e3d249d2',
     ))
コード例 #10
0
 def test_sha1_partial_calculation(self):
     """Test sha1 of partial file (1024 bytes)."""
     res = tools.compute_file_hash(self.filename, sha='sha1',
                                   bytes_to_read=1024)
     self.assertIn(res, (
         'e56fa7bd5cfdf6bb7e2d8649dd9216c03e7271e6',
         '617ce7d539848885b52355ed597a042dae1e726f',
     ))
コード例 #11
0
 def test_md5_partial_calculation(self):
     """Test md5 of partial file (1024 bytes)."""
     res = tools.compute_file_hash(self.filename, sha='md5',
                                   bytes_to_read=1024)
     self.assertIn(res, (
         'edf6e1accead082b6b831a0a600704bc',
         'be0227b6d490baa49e6d7e131c7f596b',
     ))
コード例 #12
0
ファイル: tools_tests.py プロジェクト: magul/pywikibot-core
 def test_sha224_partial_calculation(self):
     """Test sha224 of partial file (1024 bytes)."""
     res = tools.compute_file_hash(self.filename, sha='sha224',
                                   bytes_to_read=1024)
     self.assertIn(res, (
         'affa8cb79656a9b6244a079f8af91c9271e382aa9d5aa412b599e169',
         '486467144e683aefd420d576250c4cc984e6d7bf10c85d36e3d249d2',
     ))
コード例 #13
0
ファイル: tools_tests.py プロジェクト: magul/pywikibot-core
 def test_sha1_partial_calculation(self):
     """Test sha1 of partial file (1024 bytes)."""
     res = tools.compute_file_hash(self.filename, sha='sha1',
                                   bytes_to_read=1024)
     self.assertIn(res, (
         'e56fa7bd5cfdf6bb7e2d8649dd9216c03e7271e6',
         '617ce7d539848885b52355ed597a042dae1e726f',
     ))
コード例 #14
0
 def test_md5_complete_calculation(self):
     """"Test md5 of complete file."""
     res = tools.compute_file_hash(self.filename, sha='md5')
     self.assertEqual(res, '5d7265e290e6733e1e2020630262a6f3')
コード例 #15
0
 def test_sha224_complete_calculation(self):
     """"Test sha224 of complete file."""
     res = tools.compute_file_hash(self.filename, sha='sha224')
     self.assertEqual(
         res, '3d350d9d9eca074bd299cb5ffe1b325a9f589b2bcd7ba1c033ab4d33')
コード例 #16
0
 def test_sha1_partial_calculation(self):
     """"Test sha1 of partial file (1024 bytes)."""
     res = tools.compute_file_hash(self.filename,
                                   sha='sha1',
                                   bytes_to_read=1024)
     self.assertEqual(res, 'e56fa7bd5cfdf6bb7e2d8649dd9216c03e7271e6')
コード例 #17
0
 def test_sha1_complete_calculation(self):
     """"Test sha1 of complete file."""
     res = tools.compute_file_hash(self.filename, sha='sha1')
     self.assertEqual(res, '1c12696e1119493a625aa818a35c41916ce32d0c')
コード例 #18
0
 def test_md5_partial_calculation(self):
     """"Test md5 of partial file (1024 bytes)."""
     res = tools.compute_file_hash(self.filename,
                                   sha='md5',
                                   bytes_to_read=1024)
     self.assertEqual(res, 'edf6e1accead082b6b831a0a600704bc')