Пример #1
0
 def test_sens(self):
     filetype = files.RFHBloodCulturesFileType('notareal.file')
     expected = [
         u'Piperacillin-Tazobactam s', u'Amikacin s', u'Nitrofurantoin S',
         u'Levofloxacin s', u'Meropenem s', u'Gentamicin S', u'Ertapenem s',
         u'Ciprofloxacin s', u'Aztreonam s', u'Colistin s'
     ]
     self.assertEqual(expected, filetype.sens(self.row))
Пример #2
0
    def test_process_file(self):
        filetype = files.RFHBloodCulturesFileType('notareal.file')
        with patch.object(filetype, 'path') as mock_path:
            mock_path.csv.return_value.__enter__.return_value.__iter__.return_value = [
                self.row
            ]

            for container in filetype.process_file():
                self.assertEqual('RFH', container.issuing_source)
                self.assertEqual('555345', container.hospital_number)
                self.assertEqual(message_type.ResultMessage,
                                 container.message_type)
Пример #3
0
 def test_row_to_result_message(self):
     filetype = files.RFHBloodCulturesFileType('notareal.file')
     msg = filetype.row_to_result_message(self.row)
     self.assertIsInstance(msg, message_type.ResultMessage)
     self.assertEqual('BC', msg.profile_code)
Пример #4
0
 def test_res(self):
     filetype = files.RFHBloodCulturesFileType('notareal.file')
     expected = [u'Cefixime R', u'Augmentin R', u'Amphotericin R']
     self.assertEqual(expected, filetype.res(self.row))
Пример #5
0
 def test_to_date(self):
     filetype = files.RFHBloodCulturesFileType('notareal.file')
     self.assertEqual(datetime.datetime(1976, 4, 23),
                      filetype._to_date('23/4/1976'))