@@ -120,60 +120,6 @@ def test_object_view(self):
120120 self .assertEqual (self ._json_input , json_output )
121121 return
122122
123- def test_recorder (self ):
124-
125- if (python_version [0 ] == 2 and python_version [1 ] < 7 ):
126- print ("Skipping test since we're on {1}" .format ("" .join (python_version )))
127- pass
128-
129- # Grab an input/output recording, the results of a prior countmatches run
130-
131- recording = os .path .join (self ._package_path , 'recordings' , 'scpv2' , 'Splunk-6.3' , 'countmatches.' )
132-
133- with gzip .open (recording + 'input.gz' , 'rb' ) as file_1 :
134- with io .open (recording + 'output' , 'rb' ) as file_2 :
135- ifile = BytesIO (file_1 .read ())
136- result = BytesIO (file_2 .read ())
137-
138- # Set up the input/output recorders that are under test
139-
140- ifile = Recorder (mktemp (), ifile )
141-
142- try :
143- ofile = Recorder (mktemp (), BytesIO ())
144-
145- try :
146- # Read and then write a line
147- ifile .readline ()
148- ofile .write (result .readline ())
149-
150- # Read and then write a block
151- ifile .read ()
152- ofile .write (result .read ())
153-
154- # Verify that what we wrote is equivalent to the original recording, the result from a prior
155- # countmatches run
156- self .assertEqual (ofile .getvalue (), result .getvalue ())
157-
158- # Verify that we faithfully recorded the input and output files
159- ifile ._recording .close ()
160- ofile ._recording .close ()
161-
162- with gzip .open (ifile ._recording .name , 'rb' ) as file_1 :
163- with gzip .open (ofile ._recording .name , 'rb' ) as file_2 :
164- self .assertEqual (file_1 .read (), ifile ._file .getvalue ())
165- self .assertEqual (file_2 .read (), ofile ._file .getvalue ())
166-
167- finally :
168- ofile ._recording .close ()
169- os .remove (ofile ._recording .name )
170-
171- finally :
172- ifile ._recording .close ()
173- os .remove (ifile ._recording .name )
174-
175- return
176-
177123 def test_record_writer_with_random_data (self , save_recording = False ):
178124
179125 # Confirmed: [minint, maxint) covers the full range of values that xrange allows
@@ -332,7 +278,6 @@ def _load_chunks(self, ifile):
332278
333279 _json_input = six .text_type (json .dumps (_dictionary , separators = (',' , ':' )))
334280 _package_path = os .path .dirname (os .path .abspath (__file__ ))
335- _recordings_path = os .path .join (_package_path , 'recordings' , 'scpv2' , 'Splunk-6.3' )
336281
337282
338283class TestRecorder (object ):
0 commit comments