Browse files


  • Loading branch information...
1 parent 6ec5e31 commit f6885942aecc6b594ab52e6a46bec5acd0cb1924 @heynemann committed Nov 20, 2010
Showing with 2 additions and 40 deletions.
  1. +2 −40 README.mkd
@@ -14,50 +14,12 @@ My vision with MI7 is to create a mocking tool that is as Pythonic as possible.
This means that you should be able to keep your python code exactly as it is
supposed to be, and still be able to test things in isolation.
-I'll try to illustrate with an example:
- @new_mission
- @agent.spy(tests.controllers.User)
- def test_controller_verifies_if_user_is_authenticated():
- agents.User \
- .intercept('is_authenticated') \
- .returns(True)
- controller = tests.controllers.MyController()
- result = controller.index()
- assert result == "WooHoo"
- assert agents.User
- .saw('is_authenticated')
- .times == 1
-Some concepts going on here:
-* The new_mission construct starts a mission for the agents. This must be
- executed before the agents are assigned. This decorator is what will finish
- the mission, no matter what happens.
-* There's the agent.spy action. This decorator instructs our agent on his
-mission. He's supposed to keep watch of the User class in the
-mysite.controllers module.
-* The agents collection keeps track of all our agents until the end of the
-mission. The agreement is that the agents will be known by their last name so
-they are not entirely trackable (for their own safety). So in this case our
-is codenamed User, which is the last part of it's full name. If we have a
-superstar agent (aren't they all?), we can name him as he wants, like this -'Bond').
-Comedy apart, the main thing here is that the majority of my test is ABOUT the
-business and not creating mocks and expectations.
Current State
-MI7 is still building it's new office and will not be operational for a while.
+MI7 is in very early alpha version.
-Keep checking this page to see the developments.
+You can check the wiki for more details.
Name Origin

0 comments on commit f688594

Please sign in to comment.