Metadata-Version: 1.0
Name: redef
Version: 1.0
Summary: Test utility for redefining functions
Home-page: http://github.com/joeheyming/redef
Author: Joe Heyming
Author-email: joeheyming@gmail.com
License: GNU GPLv3, Python License
Download-URL: https://github.com/joeheyming/redef/zipball/master
Description: 
        
        redef was inspired by `Test::Resub
        <http://search.cpan.org/~airwave/Test-Resub-1.02/lib/Test/Resub.pm>`_.
        
        Sometimes you want to mock a bunch of test functions or objects and have the framework cleanup after you are done.  That is the philosophy of Test::Resub and redef.
        
        All you have to do is - ::
        from redef import redef
        import unittest
        
        from mymodule import Myobj
        
        class MyTest(unittest):
        def test_something(self):
        rd_foo = redef(Myobj, 'foo', lambda s: 'bar')
        assertEquals(Myobj().foo, 'bar')
        
        This example is trivial, but you can do some powerful things when you know the expected inputs of a function that is not behaving in your tests.  All you have to do is redef the bad function and make it return what you want to simulate.
        
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.4
Classifier: Programming Language :: Python :: 2.5
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
