33
44from tests .tools import get_template_config , get_unittest_dataset_config
55from trinity .buffer .buffer import get_buffer_reader
6- from trinity .common .config import StorageConfig , StorageType
7- from trinity .buffer .writer .file_writer import JSONWriter
86from trinity .buffer .reader .file_reader import RawDataReader
7+ from trinity .buffer .writer .file_writer import JSONWriter
8+ from trinity .common .config import StorageConfig , StorageType
99
1010
1111class TestFileReader (unittest .TestCase ):
12-
13- temp_output_path = 'tmp/test_file_buffer/'
12+ temp_output_path = "tmp/test_file_buffer/"
1413
1514 @classmethod
1615 def setUpClass (cls ):
@@ -21,7 +20,7 @@ def setUpClass(cls):
2120 def tearDownClass (cls ):
2221 super ().tearDownClass ()
2322 if os .path .exists (cls .temp_output_path ):
24- os .system (f' rm -rf { cls .temp_output_path } ' )
23+ os .system (f" rm -rf { cls .temp_output_path } " )
2524
2625 def test_file_buffer (self ):
2726 meta = StorageConfig (
@@ -31,10 +30,10 @@ def test_file_buffer(self):
3130 raw = True ,
3231 )
3332 data = [
34- {' key1' : 1 , ' key2' : 2 },
35- {' key1' : 3 , ' key2' : 4 },
36- {' key1' : 5 , ' key2' : 6 },
37- {' key1' : 7 , ' key2' : 8 },
33+ {" key1" : 1 , " key2" : 2 },
34+ {" key1" : 3 , " key2" : 4 },
35+ {" key1" : 5 , " key2" : 6 },
36+ {" key1" : 7 , " key2" : 8 },
3837 ]
3938
4039 # test writer
@@ -49,6 +48,7 @@ def test_file_buffer(self):
4948 self .assertEqual (len (loaded_data ), 4 )
5049 self .assertEqual (loaded_data , data )
5150 self .assertRaises (StopIteration , reader .read )
51+
5252 def test_file_reader (self ):
5353 """Test file reader."""
5454 config = get_template_config ()
@@ -74,5 +74,3 @@ def test_file_reader(self):
7474 except StopIteration :
7575 break
7676 self .assertEqual (len (tasks ), 16 * 2 - 4 )
77-
78-
0 commit comments