Пример #1
0
    def test_plate_map_handler_get_request(self):
        regex = 'Plate 100 doesn\'t exist'
        with self.assertRaisesRegex(HTTPError, regex):
            plate_map_handler_get_request(100)

        obs = plate_map_handler_get_request(21)
        exp_plate_confs = [[1, '96-well deep-well plate', 8, 12],
                           [2, '96-well microtiter plate', 8, 12],
                           [3, '384-well microtiter plate', 16, 24],
                           [4, '96-well template plate', 8, 12],
                           [5, '384-well template plate', 16, 24]]
        exp = {
            'plate_confs': exp_plate_confs,
            'plate_id': 21,
            'process_id': 10
        }
        self.assertEqual(obs, exp)

        obs = plate_map_handler_get_request(None)
        exp = {
            'plate_confs': exp_plate_confs,
            'plate_id': None,
            'process_id': None
        }
        self.assertEqual(obs, exp)
Пример #2
0
    def test_plate_map_handler_get_request(self):
        regex = 'Plating process 100 doesn\'t exist'
        with self.assertRaisesRegex(HTTPError, regex):
            plate_map_handler_get_request(100)

        obs = plate_map_handler_get_request(10)
        exp_plate_confs = [[1, '96-well deep-well plate', 8, 12],
                           [2, '96-well microtiter plate', 8, 12],
                           [3, '384-well microtiter plate', 16, 24]]
        exp_contr_desc = [
            {'external_id': 'blank',
             'description': 'gDNA extraction blanks. Represents an empty '
                            'extraction well.'},
            {'external_id': 'empty',
             'description': 'Empty well. Represents an empty well that should '
                            'not be included in library preparation.'},
            {'external_id': 'vibrio.positive.control',
             'description': 'Bacterial isolate control (Vibrio fischeri ES114)'
                            '. Represents an extraction well loaded with '
                            'Vibrio.'},
            {'external_id': 'zymo.mock',
             'description': 'Bacterial community control (Zymo Mock D6306). '
                            'Represents an extraction well loaded with Zymo '
                            'Mock community.'}]
        exp = {'plate_confs': exp_plate_confs, 'plate_id': 21,
               'process_id': 10, 'controls_description': exp_contr_desc}
        self.assertEqual(obs, exp)

        obs = plate_map_handler_get_request(None)
        exp = {'plate_confs': exp_plate_confs, 'plate_id': None,
               'process_id': None, 'controls_description': exp_contr_desc}
        self.assertEqual(obs, exp)