Exemple #1
0
    def test_accept_any_sentence_and_create_unit_or_assign_it(self):
        long_sentence = '''<p>The reactor pressure vessel temperatures in <strong>Unit 1</strong> remain above cold shutdown conditions. The indicated temperature at the feedwater nozzle of the reactor pressure vessel is 138 &deg;C and at the bottom of reactor pressure vessel is 111 &deg;C.</p>
<p>The reactor pressure vessel temperatures in <strong>Unit 2</strong> remain above cold shutdown conditions. The indicated temperature at the feed water nozzle of the reactor pressure vessel is 123 &deg;C. The reactor pressure vessel and the dry well remain at atmospheric pressure. Fresh water injection (approximately 38 tonnes) to the spent fuel pool via the spent fuel pool cooling line was carried out on 25 April.</p>
<p>The temperature at the bottom of the reactor pressure vessel in <strong>Unit 3</strong> remains above cold shutdown conditions. The indicated temperature at the feed water nozzle of the reactor pressure vessel is 75 &deg;C and at the bottom of the reactor pressure vessel is 111 &deg;C. The reactor pressure vessel and the dry well remain at atmospheric pressure.</p>
'''
        sentences = long_sentence.split('.')

        unit_parser = UnitSentenceParser()
        for sentence in sentences:
            unit_parser.accept(sentence)

        self.assertEqual(len(unit_parser.units), 3)

        self.assertEqual(unit_parser.units['1'].feedwater_nozzle_temp, '138')
        self.assertEqual(unit_parser.units['2'].feedwater_nozzle_temp, '123')
        self.assertEqual(unit_parser.units['3'].feedwater_nozzle_temp, '75')
        self.assertEqual(unit_parser.units['3'].reactor_bottom_temp, '111')