Пример #1
0
 def test_empty_not_baked(self):
     add5_installer = multimethod.Installer(self.add,
                                            '__add5', [{}, {}],
                                            baked_perform_call=False)
     assert add5_installer.is_empty()
     if multimethod.Installer is multimethod.InstallerVersion1:
         assert len(add5_installer.to_install) == 0
     add5 = add5_installer.install()
     assert add5[0] == ['space', 'arg0', 'arg1']
     assert add5[1] == 'raiseFailedToImplement()'
     assert isinstance(add5[2], dict)
     assert add5[3]
Пример #2
0
 def test_empty(self):
     add3_installer = multimethod.Installer(self.add, '__add3', [{}, {}])
     assert add3_installer.is_empty()
     if multimethod.Installer is multimethod.InstallerVersion1:
         assert len(add3_installer.to_install) == 1
         assert add3_installer.to_install[0][0] is None