def test_wraps_with_cleaned_sig(self): wrapped_function = _wraps_with_cleaned_sig(FakeDeltaGenerator.fake_text, 2) wrapped = wrapped_function.keywords.get("wrapped") # Check meta data. self.assertEqual("delta_generator_test", wrapped.__module__) self.assertEqual("fake_text", wrapped.__name__) self.assertEqual("Fake text delta generator.", wrapped.__doc__) # Verify original signature sig = signature(FakeDeltaGenerator.fake_text) self.assertEqual(str(sig), "(self, element, body)") # Check clean signature sig = signature(wrapped) self.assertEqual(str(sig), "(body)")
def test_wraps_with_cleaned_sig(self): wrapped_function = (_wraps_with_cleaned_sig( FakeDeltaGenerator.fake_text)) wrapped = wrapped_function.keywords.get('wrapped') # Check meta data. self.assertEqual(wrapped.__module__, 'delta_generator_test') self.assertEqual(wrapped.__name__, 'fake_text') self.assertEqual(wrapped.__doc__, 'Fake text delta generator.') # Verify original signature sig = signature(FakeDeltaGenerator.fake_text) self.assertEqual(str(sig), '(self, element, body)') # Check clean signature sig = signature(wrapped) self.assertEqual(str(sig), '(body)')