Ejemplo n.º 1
0
 def _build_from_input_dict(cls, input_dict: dict):
     stat_book_collection = StatBookCollection.from_dict(
         input_dict.pop("stat_book_collection"))
     base_kern_freq_names = input_dict.pop("base_kern_freq_names")
     tracker = super()._build_from_input_dict(input_dict)
     tracker.stat_book_collection = stat_book_collection
     tracker.base_kern_freq_names = base_kern_freq_names
     return tracker
Ejemplo n.º 2
0
    def test_from_dict(self):
        sbc = StatBookCollection()
        sbc.create_shared_stat_books(self.sb_names, self.ms_names)

        actual = StatBookCollection.from_dict(sbc.to_dict())
        self.assertEqual(sbc.stat_book_names(), actual.stat_book_names())

        expected_ms_names = [sb.multi_stats_names() for sb in sbc.stat_book_list()]
        actual_ms_names = [sb.multi_stats_names() for sb in actual.stat_book_list()]
        self.assertListEqual(expected_ms_names, actual_ms_names)