5
5
except ImportError :
6
6
import unittest
7
7
8
- from csvkit .cleanup import extract_joinable_row_errors , join_rows
8
+ from csvkit .cleanup import join_rows
9
9
from csvkit .exceptions import CSVTestException , LengthMismatchError
10
10
11
11
@@ -25,45 +25,6 @@ def test_fix_rows(self):
25
25
self .assertEqual (" " .join ([start [0 ][- 1 ], start [1 ][0 ], start [2 ][0 ], start [3 ][0 ]]), fixed [2 ])
26
26
self .assertEqual (start [3 ][1 ], fixed [3 ])
27
27
28
- def test_extract_joinable_row_errors (self ):
29
- e1 = LengthMismatchError (1 , ['foo' , 'bar' , 'baz' ], 10 )
30
- e2 = LengthMismatchError (2 , ['foo' , 'bar' , 'baz' ], 10 )
31
- e3 = LengthMismatchError (3 , ['foo' , 'bar' , 'baz' ], 10 )
32
- errs = [e1 , e2 , e3 ]
33
- joinable = extract_joinable_row_errors (errs )
34
- self .assertEqual (3 , len (joinable ))
35
- for e , j in zip (errs , joinable ):
36
- self .assertTrue (e is j )
37
-
38
- def test_extract_joinable_row_errors_2 (self ):
39
- e1 = LengthMismatchError (1 , ['foo' , 'bar' , 'baz' ], 10 )
40
- e2 = CSVTestException (2 , ['foo' , 'bar' , 'baz' ], "A throwaway message." )
41
- e3 = LengthMismatchError (3 , ['foo' , 'bar' , 'baz' ], 10 )
42
- errs = [e1 , e2 , e3 ]
43
- joinable = extract_joinable_row_errors (errs )
44
- self .assertEqual (1 , len (joinable ))
45
- self .assertTrue (next (iter (joinable )) is e3 )
46
-
47
- def test_extract_joinable_row_errors_3 (self ):
48
- e1 = CSVTestException (1 , ['foo' , 'bar' , 'baz' ], "A throwaway message." )
49
- e2 = LengthMismatchError (2 , ['foo' , 'bar' , 'baz' ], 10 )
50
- e3 = LengthMismatchError (3 , ['foo' , 'bar' , 'baz' ], 10 )
51
- errs = [e1 , e2 , e3 ]
52
- joinable = extract_joinable_row_errors (errs )
53
- self .assertEqual (2 , len (joinable ))
54
- joinable = list (joinable )
55
- self .assertTrue (joinable [0 ] is e2 )
56
- self .assertTrue (joinable [1 ] is e3 )
57
-
58
- def test_extract_joinable_row_errors_4 (self ):
59
- e1 = CSVTestException (1 , ['foo' , 'bar' , 'baz' ], "A throwaway message." )
60
- e2 = LengthMismatchError (2 , ['foo' , 'bar' , 'baz' ], 10 )
61
- e3 = LengthMismatchError (4 , ['foo' , 'bar' , 'baz' ], 10 )
62
- errs = [e1 , e2 , e3 ]
63
- joinable = extract_joinable_row_errors (errs )
64
- self .assertEqual (1 , len (joinable ))
65
- self .assertTrue (next (iter (joinable )) is e3 )
66
-
67
28
def test_real_world_join_fail (self ):
68
29
start = [['168772' , '1102' , '$0.23 TO $0.72' , 'HOUR' , '1.5%' ],
69
30
['GROSS' , '1.5% ' ],
0 commit comments