def test_invalid_filenames(self): names = [ 'RVF1234567890.wav', 'N20194857389.wav', 'F2910594839992.wav' '123456789012.wav' ] for x in names: with self.assertRaises(Exception): WavFile(x)
def setUp(self): self.audiodir = './audio/' self.lname = self.audiodir + 'left.wav' self.rname = self.audiodir + 'right.wav' for x in [self.lname, self.rname]: if os.path.isfile(x): os.remove(x) self.files = sorted([ WavFile(self.audiodir + f) for f in os.listdir(self.audiodir) if f.endswith('.wav') ], key=lambda x: x.timestamp) self.left = [x for x in self.files if x.channel == 'L'] self.right = [x for x in self.files if x.channel == 'R']
def setUp(self): self.example = WavFile('./audio/F20150101120000.wav')