예제 #1
0
 def QuickRename(self, *_event):
     self.anonList = self.prefDlg.pages['Anonymization'].anonList
     dlg = QuickRenameDlg(self,
                          -1,
                          'Anonymize',
                          size=(250, 160),
                          anonList=self.anonList)
     dlg.ShowModal()
예제 #2
0
    def test_no_patient_name_anonlist(self):
        a = AnonymizeList(self.frame)
        dlg = QuickRenameDlg(self.frame, anonList=a)

        expected = {
            'PatientName': '',
            'PatientID': '%(PatientName)s',
        }

        assert dlg.GetValues() == expected
예제 #3
0
    def test_on_accept(self):
        name = 'Patient0'
        a = AnonymizeList(self.frame)
        a.SetStringItems(['PatientName', 'PatientID'])
        a.SetReplacementDict({'PatientName': name, 'PatientID': 'ignored'})

        dlg = QuickRenameDlg(self.frame, anonList=a)

        dlg.OnAccept()

        assert a.GetReplacementDict()['PatientID'] == '%(PatientName)s'
        assert a.GetReplacementDict()['PatientName'] == name
예제 #4
0
    def test_patient_name_anonlist(self):
        name = 'Patient0'
        a = AnonymizeList(self.frame)
        a.SetStringItems(['PatientName'])
        a.SetReplacementDict({'PatientName': name})

        dlg = QuickRenameDlg(self.frame, anonList=a)

        expected = {
            'PatientName': name,
            'PatientID': '%(PatientName)s',
        }

        assert dlg.GetValues() == expected