Exemplo n.º 1
0
 def test_analysis_from_config(self):
     """Test analysis config dataclass"""
     analysis = FakeAnalysis(arg1=10, arg2=20)
     analysis.set_options(option1=False, option2=True)
     config = analysis.config()
     loaded = FakeAnalysis.from_config(config)
     self.assertEqual(config, loaded.config())
Exemplo n.º 2
0
 def test_analysis_from_dict_config(self):
     """Test analysis config dataclass for dict type."""
     analysis = FakeAnalysis(arg1=10, arg2=20)
     analysis.set_options(option1=False, option2=True)
     config = analysis.config()
     loaded = FakeAnalysis.from_config({
         "kwargs": config.kwargs,
         "options": config.options
     })
     self.assertEqual(config, loaded.config())