Metadata-Version: 1.1
Name: sealedmock
Version: 0.1.0
Summary: Mocks that whitelist its interface
Home-page: https://github.com/Mariocj89/sealedmock
Author: Mario Corchero
Author-email: mariocj89@gmail.com
License: MIT
Description: |Build Status| # Sealed Mock Small utility to ease the process of
        defining and working with mocks.
        
        It allows you to stop the process of the mocks automatically creating
        other mocks at any point.
        
        SealedMock allows you to define a point in your test where the mocks
        provided should stop generating mocks automatically preventing test pass
        when they call attributes they should not have been called.
        
        Install
        =======
        
        ``pip install sealedmock``
        
        Usage
        =====
        
        Given you have a file like:
        
        .. code:: python
        
            import urllib2
        
            class SampleCodeClass(object):
                """This is sample code"""
                def calling_urlopen(self):
                    return urllib2.urlopen("http://chooserandom.com")
        
                def calling_splithost(self):
                    return urllib2.splithost("//host:port/path")
        
        You can write a test like:
        
        .. code:: python
        
            @patch("tests.sample_code.urllib2")
            def test_using_decorator(mock):
                    sample = sample_code.SampleCodeClass()
                    mock.urlopen.return_value = 2
                    mock.sealed = True
        
                    # calling urlopen succeeds as mock.urlopen has been defined
                    assert sample.calling_urlopen()
        
                    # This will fail as mock.splithost has not been defined
                    sample.calling_splithost()
        
        .. |Build Status| image:: https://travis-ci.org/Mariocj89/sealedmock.svg?branch=master
           :target: https://travis-ci.org/Mariocj89/sealedmock
        
Keywords: mock,testing,unittest,integration,whitelist
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
