def _saveTestWavFile(self, filename, wav_data): with open(filename, "wb") as f: file_path = os.path.join(dir_name, "some_audio_%d.wav" % i) self._saveTestWavFile(file_path, wav_data)