Exemple #1
0
    def test_load(self):
        sbc = StatBookCollection()
        sbc.create_shared_stat_books(self.sb_names, self.ms_names)

        fname = "test_save"
        out_fname = sbc.save(fname)

        new_sbc = StatBookCollection.load(out_fname)

        self.assertEqual(sbc.stat_book_names(), new_sbc.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 new_sbc.stat_book_list()]
        self.assertListEqual(expected_ms_names, actual_ms_names)

        self.addCleanup(os.remove, out_fname)
 def load(output_file_name: str):
     mst = ModelSearchLogger()
     sbc = StatBookCollection.load(output_file_name)
     mst.stat_book_collection = sbc
     return mst