def test_trajectorylog(self): tlog_file = osp.join(self.anon_folder, 'PatientID_4DC Treatment_JST90_TX_20140712094246.bin') tlog = MachineLog(tlog_file) tlog.anonymize() files = tlog.anonymize(inplace=True, suffix='inplace') self.assertIsInstance(files, list) for file in files: self.assertTrue('inplace' in file)
def test_dynalog(self): # test making an anonymized copy dlog_file = osp.join(self.anon_folder, 'A1234_patientid.dlg') dlog = MachineLog(dlog_file) dlog.anonymize() # test doing inplace anonymization files = dlog.anonymize(inplace=True, suffix='inplace') self.assertIsInstance(files, list) for file in files: self.assertTrue('inplace' in file)
def test_trajectorylog(self): tlog_file = osp.join( self.anon_folder, 'PatientID_4DC Treatment_JST90_TX_20140712094246.bin') tlog = MachineLog(tlog_file) tlog.anonymize() files = tlog.anonymize(inplace=True, suffix='inplace') self.assertIsInstance(files, list) for file in files: self.assertTrue('inplace' in file)
def test_bad_name(self): """Test that a log with a bad name (no underscore) fails gracefully.""" dlog_file = osp.join(self.anon_folder, 'A1234patientid.dlg') dlog = MachineLog(dlog_file) with self.assertRaises(NameError): dlog.anonymize()
def test_destination(self): tlog_file = osp.join(self.anon_folder, 'PatientID_4DC Treatment_JST90_TX_20140712094246.bin') tlog = MachineLog(tlog_file) tlog.anonymize(destination=self.anon_folder) # shouldn't raise
def test_destination(self): tlog_file = osp.join( self.anon_folder, 'PatientID_4DC Treatment_JST90_TX_20140712094246.bin') tlog = MachineLog(tlog_file) tlog.anonymize(destination=self.anon_folder) # shouldn't raise