Project

General

Profile

Task #2491

Task #2484: Python 3 support

Hash Helper produces different results on Python 3

Added by Luke Murphey over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Input: Web Spider
Target version:
Start date:
11/05/2019
Due date:
% Done:

100%

Associated revisions

Revision 717 (diff)
Added by lmurphey over 4 years ago

Fixing hash helper issues

Reference #2491

Revision 718 (diff)
Added by lmurphey over 4 years ago

More fixed for hash helper

Reference #2491

Revision 719 (diff)
Added by lmurphey over 4 years ago

Test changes for hash helper

Reference #2491

History

#1 Updated by Luke Murphey over 4 years ago

     [exec] ======================================================================
     [exec] FAIL: test_hash_dictionary_sorting (__main__.TestHashHelper)
     [exec] ----------------------------------------------------------------------
     [exec] Traceback (most recent call last):
     [exec]   File "unit.py", line 1019, in test_hash_dictionary_sorting
     [exec]     self.assertEqual(pre_sorted, '2162da53bd7307db3595f0f3c8c845960cfbc1a707c1af513c66a1e2')
     [exec] AssertionError: '02d3ab5a99ba3545ca55b2d489a6ec4342c7f97ea13fe145a7bcd358' != '2162da53bd7307db3595f0f3c8c845960cfbc1a707c1af513c66a1e2'
     [exec] - 02d3ab5a99ba3545ca55b2d489a6ec4342c7f97ea13fe145a7bcd358
     [exec] + 2162da53bd7307db3595f0f3c8c845960cfbc1a707c1af513c66a1e2
     [exec] 
     [exec] 
     [exec] ======================================================================
     [exec] FAIL: test_hash_dictionary_with_list (__main__.TestHashHelper)
     [exec] ----------------------------------------------------------------------
     [exec] Traceback (most recent call last):
     [exec]   File "unit.py", line 1047, in test_hash_dictionary_with_list
     [exec]     self.assertEqual(pre_sorted, '2162da53bd7307db3595f0f3c8c845960cfbc1a707c1af513c66a1e2')
     [exec] AssertionError: '02d3ab5a99ba3545ca55b2d489a6ec4342c7f97ea13fe145a7bcd358' != '2162da53bd7307db3595f0f3c8c845960cfbc1a707c1af513c66a1e2'
     [exec] - 02d3ab5a99ba3545ca55b2d489a6ec4342c7f97ea13fe145a7bcd358
     [exec] + 2162da53bd7307db3595f0f3c8c845960cfbc1a707c1af513c66a1e2

#2 Updated by Luke Murphey over 4 years ago

From Python 3:

     [exec] Hashing:  {'A': 'aaaa', 'B': 'bbbb', 'One': 1, 2: 'Two', 'list': [1, 2, 3, 4]}
     [exec] Hashing:  A
     [exec] Hashing:  aaaa
     [exec] Hashing:  B
     [exec] Hashing:  bbbb
     [exec] Hashing:  One
     [exec] Hashing:  1
     [exec] Hashing:  [1, 2, 3, 4]
     [exec] Hashing:  1
     [exec] Hashing:  2
     [exec] Hashing:  3
     [exec] Hashing:  4
     [exec] Hashing:  2
     [exec] Hashing:  Two

     [exec] AssertionError: '02d3ab5a99ba3545ca55b2d489a6ec4342c7f97ea13fe145a7bcd358' != '2162da53bd7307db3595f0f3c8c845960cfbc1a707c1af513c66a1e2'
     [exec] ('Hashing: ', {'A': 'aaaa', 'B': 'bbbb', 2: 'Two', 'One': 1, 'list': [1, 2, 3, 4]})
     [exec] ('Hashing: ', 'A')
     [exec] ('Hashing: ', 'aaaa')
     [exec] ('Hashing: ', 'B')
     [exec] ('Hashing: ', 'bbbb')
     [exec] ('Hashing: ', 'One')
     [exec] ('Hashing: ', 1)
     [exec] ('Hashing: ', 'list')
     [exec] ('Hashing: ', [1, 2, 3, 4])
     [exec] ('Hashing: ', 1)
     [exec] ('Hashing: ', 2)
     [exec] ('Hashing: ', 3)
     [exec] ('Hashing: ', 4)
     [exec] ('Hashing: ', 2)
     [exec] ('Hashing: ', 'Two')

AssertionError: '02d3ab5a99ba3545ca55b2d489a6ec4342c7f97ea13fe145a7bcd358' != '2162da53bd7307db3595f0f3c8c845960cfbc1a707c1af513c66a1e2'

#3 Updated by Luke Murphey over 4 years ago

  • The change is caused by the custom sort key

#4 Updated by Luke Murphey over 4 years ago

  • Category set to Input: Web Spider
  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF