def test_dontCallInstanceMethodsThatArentReady(self): """ L{crefutil._InstanceMethod} raises L{AssertionError} to indicate it should not be called. This should not be possible with any of its API clients, but is provided for helping to debug. """ self.assertRaises(AssertionError, crefutil._InstanceMethod( "no_name", crefutil.NotKnown(), type))
def test_dontPutCircularReferencesInDictionaryKeys(self): """ If a dictionary key contains a circular reference (which is probably a bad practice anyway) it will be resolved by a L{crefutil._DictKeyAndValue}, not by placing a L{crefutil.NotKnown} into a dictionary key. """ self.assertRaises(AssertionError, dict().__setitem__, crefutil.NotKnown(), "value")