Giter VIP home page Giter VIP logo

minimocktest's Introduction

MiniMockTest

https://requires.io/github/pykler/MiniMockTest/requirements.png?branch=master

Documentation

This module provides a class which extends unittest.TestCase which can be used to easily mock objects in a test case. This module can be used in conjunction with other test case classes by means of multiple inheritance http://docs.python.org/tutorial/classes.html#multiple-inheritance

An example of using Django's test case with this module's test case is simply as follows:

from minimocktest import MockTestCase
from django.test import TestCase
from django.test.client import Client

class DjangoTestCase(TestCase, MockTestCase):
    '''
    A TestCase class that combines minimocktest and django.test.TestCase
    '''

    def _pre_setup(self):
        TestCase._pre_setup(self)
        MockTestCase.setUp(self)
        # optional: shortcut client handle for quick testing
        self.client = Client()

    def _post_teardown(self):
        MockTestCase.tearDown(self)
        TestCase._post_teardown(self)

    def setUp(self):
        pass

    def tearDown(self):
        pass

COPYING

This module is provided under the terms of the MIT Licence. The code in this module relies on the "minimock" library which is included as part of the package. The copyright notice for "minimock" is included at the beginning of its source code file.

For more information, see the file LICENCSE or http://www.opensource.org/licenses/mit-license.php

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.