@@ -40,13 +40,13 @@ def test_xlsx_xlrd_duplicate_fields(self):
40
40
assert sheet [1 ][0 ] == {'Name' : 1.0 , 'Dup (1)' : 2.0 , 'Dup (2)' : 3.0 ,
41
41
'Dup (3)' : 4.0 , 'Dup (4)' : 5.0 , 'Not Dup' : 6.0 }
42
42
43
- # After demo it was suggested the iteration cap be raised. The value ended up to be about 5,000
44
- # Unsure best way to test this case with such a high cap. Going to leave the test for now
45
- # def test_xlsx_xlrd_duplicate_fields_handle_naming(self):
46
- # with open(os.path.join(BASE, 'files', 'test_duplicate_uuid.xlsx')) as fp:
47
- # sheets = xlrd_tools.xlsx_xlrd(fp)
48
- # print(sheets)
49
- # sheet = sheets.popitem()[1]
50
-
51
- # assert sheet[0][1]['field'] != 'dup (12)'
52
- # assert len(sheet[0][1]['field']) > 24
43
+ def test_xlsx_xlrd_duplicate_fields_handle_naming ( self ):
44
+ with open ( os . path . join ( BASE , 'files' , 'test_duplicate_uuid.xlsx' )) as fp :
45
+ sheets = xlrd_tools . xlsx_xlrd ( fp , max_iterations = 10 )
46
+
47
+ sheet = sheets . popitem ()[ 1 ]
48
+
49
+ # this if you raise max iterations, it will be named dup (13) instead of dup (<uuid>)
50
+ assert sheet [ 0 ][ 1 ][ 'field' ] != 'dup (13)'
51
+ # using `len` is an easy way to see the uuid has been appended
52
+ assert len (sheet [0 ][1 ]['field' ]) > 24
0 commit comments