Exemplo n.º 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()
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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