Example #1
0
    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)
Example #2
0
    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)
Example #3
0
    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)
Example #4
0
    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)
Example #5
0
 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()
Example #6
0
 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
Example #7
0
 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()
Example #8
0
 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