Ejemplo n.º 1
0
 def test_equal_except_for(self):
     from pyfusion.utils.debug import equal_except_for
     d1 = Dummy(a=1, b=2, abc=3)
     d2 = Dummy(a=1, b=2)
     self.assertFalse(equal_except_for(d1, d2))
     self.assertTrue(equal_except_for(d1, d1))
     self.assertTrue(equal_except_for(d1, d2, ['b', 'abc']))
     self.assertTrue(equal_except_for(d1, d2, 'abc'))
Ejemplo n.º 2
0
 def test_equal_except_for(self):
     from pyfusion.utils.debug import equal_except_for
     d1 = Dummy(a=1, b=2, abc=3)
     d2 = Dummy(a=1, b=2)
     self.assertFalse(equal_except_for(d1, d2))
     self.assertTrue(equal_except_for(d1, d1))
     self.assertTrue(equal_except_for(d1, d2, ['b', 'abc']))
     self.assertTrue(equal_except_for(d1, d2, 'abc'))
Ejemplo n.º 3
0
 def testEqualityConfigOrArgs(self):
     """Check that config  and kwarg instantiated Acquisition classes
     are same."""
     acq_from_config = BaseAcquisition('test_baseacq')
     # create a BaseAcquisition instance with keyword args
     config_dict = get_config_as_dict('Acquisition', 'test_baseacq')
     acq_from_kwargs = BaseAcquisition(**config_dict)
     # Acquistion   instantiated  only   from  keywords   won't  have
     # config_name set but should otherwise be equal
     self.assertTrue(equal_except_for(acq_from_config,
                                      acq_from_kwargs, 'config_name'))
Ejemplo n.º 4
0
 def testEqualityConfigOrArgs(self):
     """Check that config  and kwarg instantiated Acquisition classes
     are same."""
     acq_from_config = BaseAcquisition('test_baseacq')
     # create a BaseAcquisition instance with keyword args
     config_dict = get_config_as_dict('Acquisition', 'test_baseacq')
     acq_from_kwargs = BaseAcquisition(**config_dict)
     # Acquistion   instantiated  only   from  keywords   won't  have
     # config_name set but should otherwise be equal
     self.assertTrue(
         equal_except_for(acq_from_config, acq_from_kwargs, 'config_name'))