def testProbe(self): # Loop over various IdlFile files: for f, known in zip(self.filelist, self.knownResponses): # Probe to get format, binary information: response = pb._probe_idlfile(f) # Test for correct responses: for r, k in zip(response, known): self.assertEqual(r, k)
def testOneFrame(self): '''Test files that only have one epoch frame.''' # Open files, get file properties, then probe header and test # against known values: for f, known in zip(self.files_single, self.knownSingle): props = pb._probe_idlfile(f) with open(f, 'rb') as data: info = pb._scan_bin_header(data, *props[1:]) for key in known: self.assertEqual(info[key], known[key])
def testMultiFrame(self): '''Test files that have more than one epoch frame.''' # Test the only two frames in the file. # The ability to scan the number of entries in a file is # located within the IdlBin class. props = pb._probe_idlfile(self.file_multi) with open(self.file_multi, 'rb') as data: for known in self.knownMulti: info = pb._scan_bin_header(data, *props[1:]) for key in known: self.assertEqual(info[key], known[key])