@@ -26,9 +26,7 @@ def test_open(self):
2626 self .assertListEqual (data , self .seq .open (file_name ).to_list ())
2727
2828 text = "" .join (data ).split ("," )
29- self .assertListEqual (
30- text , self .seq .open (file_name , delimiter = "," ).to_list ()
31- )
29+ self .assertListEqual (text , self .seq .open (file_name , delimiter = "," ).to_list ())
3230
3331 with self .assertRaises (ValueError ):
3432 self .seq .open (file_name , mode = "w" ).to_list ()
@@ -37,21 +35,27 @@ def test_open_gzip(self):
3735 expect = ["line0\n " , "line1\n " , "line2" ]
3836 self .assertListEqual (
3937 expect ,
40- self .seq .open (f"{ project_root } /functional/test/data/test.txt.gz" , mode = "rt" ).to_list (),
38+ self .seq .open (
39+ f"{ project_root } /functional/test/data/test.txt.gz" , mode = "rt"
40+ ).to_list (),
4141 )
4242
4343 def test_open_bz2 (self ):
4444 expect = ["line0\n " , "line1\n " , "line2" ]
4545 self .assertListEqual (
4646 expect ,
47- self .seq .open (f"{ project_root } /functional/test/data/test.txt.bz2" , mode = "rt" ).to_list (),
47+ self .seq .open (
48+ f"{ project_root } /functional/test/data/test.txt.bz2" , mode = "rt"
49+ ).to_list (),
4850 )
4951
5052 def test_open_xz (self ):
5153 expect = ["line0\n " , "line1\n " , "line2" ]
5254 self .assertListEqual (
5355 expect ,
54- self .seq .open (f"{ project_root } /functional/test/data/test.txt.xz" , mode = "rt" ).to_list (),
56+ self .seq .open (
57+ f"{ project_root } /functional/test/data/test.txt.xz" , mode = "rt"
58+ ).to_list (),
5559 )
5660
5761 def test_disable_compression (self ):
@@ -155,46 +159,60 @@ def test_csv_dict_reader(self):
155159 self .seq .csv_dict_reader (1 )
156160
157161 def test_gzip_csv (self ):
158- result = self .seq .csv (f"{ project_root } /functional/test/data/test.csv.gz" ).to_list ()
162+ result = self .seq .csv (
163+ f"{ project_root } /functional/test/data/test.csv.gz"
164+ ).to_list ()
159165 expect = [["1" , "2" , "3" , "4" ], ["a" , "b" , "c" , "d" ]]
160166 self .assertEqual (expect , result )
161167 with self .assertRaises (ValueError ):
162168 self .seq .csv (1 )
163169
164170 def test_bz2_csv (self ):
165- result = self .seq .csv (f"{ project_root } /functional/test/data/test.csv.bz2" ).to_list ()
171+ result = self .seq .csv (
172+ f"{ project_root } /functional/test/data/test.csv.bz2"
173+ ).to_list ()
166174 expect = [["1" , "2" , "3" , "4" ], ["a" , "b" , "c" , "d" ]]
167175 self .assertEqual (expect , result )
168176 with self .assertRaises (ValueError ):
169177 self .seq .csv (1 )
170178
171179 def test_xz_csv (self ):
172- result = self .seq .csv (f"{ project_root } /functional/test/data/test.csv.xz" ).to_list ()
180+ result = self .seq .csv (
181+ f"{ project_root } /functional/test/data/test.csv.xz"
182+ ).to_list ()
173183 expect = [["1" , "2" , "3" , "4" ], ["a" , "b" , "c" , "d" ]]
174184 self .assertEqual (expect , result )
175185 with self .assertRaises (ValueError ):
176186 self .seq .csv (1 )
177187
178188 def test_jsonl (self ):
179- result_0 = self .seq .jsonl (f"{ project_root } /functional/test/data/test.jsonl" ).to_list ()
189+ result_0 = self .seq .jsonl (
190+ f"{ project_root } /functional/test/data/test.jsonl"
191+ ).to_list ()
180192 expect_0 = [[1 , 2 , 3 ], {"a" : 1 , "b" : 2 , "c" : 3 }]
181193 self .assertEqual (expect_0 , result_0 )
182194 result_1 = self .seq .jsonl (["[1, 2, 3]" , "[4, 5, 6]" ])
183195 expect_1 = [[1 , 2 , 3 ], [4 , 5 , 6 ]]
184196 self .assertEqual (expect_1 , result_1 )
185197
186198 def test_gzip_jsonl (self ):
187- result_0 = self .seq .jsonl (f"{ project_root } /functional/test/data/test.jsonl.gz" ).to_list ()
199+ result_0 = self .seq .jsonl (
200+ f"{ project_root } /functional/test/data/test.jsonl.gz"
201+ ).to_list ()
188202 expect_0 = [[1 , 2 , 3 ], {"a" : 1 , "b" : 2 , "c" : 3 }]
189203 self .assertEqual (expect_0 , result_0 )
190204
191205 def test_bz2_jsonl (self ):
192- result_0 = self .seq .jsonl (f"{ project_root } /functional/test/data/test.jsonl.bz2" ).to_list ()
206+ result_0 = self .seq .jsonl (
207+ f"{ project_root } /functional/test/data/test.jsonl.bz2"
208+ ).to_list ()
193209 expect_0 = [[1 , 2 , 3 ], {"a" : 1 , "b" : 2 , "c" : 3 }]
194210 self .assertEqual (expect_0 , result_0 )
195211
196212 def test_xz_jsonl (self ):
197- result_0 = self .seq .jsonl (f"{ project_root } /functional/test/data/test.jsonl.xz" ).to_list ()
213+ result_0 = self .seq .jsonl (
214+ f"{ project_root } /functional/test/data/test.jsonl.xz"
215+ ).to_list ()
198216 expect_0 = [[1 , 2 , 3 ], {"a" : 1 , "b" : 2 , "c" : 3 }]
199217 self .assertEqual (expect_0 , result_0 )
200218
0 commit comments