Created
July 18, 2013 21:30
-
-
Save andersonvom/6033270 to your computer and use it in GitHub Desktop.
Sample test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Testing deployment/router.py # get_deployments | |
| def test_filter_by_name(self): | |
| self.mox.StubOutWithMock(bottle.request.query, "get") | |
| self.mox.StubOutWithMock(bottle.request.query, "getall") | |
| self.mox.StubOutWithMock(self.manager, "get_deployments") | |
| # FIXME: I just want to get the test to pass first | |
| bottle.request.query.get('show_deleted').AndReturn('') | |
| bottle.request.query.getall('statuses').AndReturn([]) | |
| bottle.request.query.get('name').AndReturn('fake name') | |
| bottle.request.query.get('blueprint').AndReturn('fake blueprint') | |
| self.manager.get_deployments().AndReturn(42) | |
| self.mox.ReplayAll() | |
| result = self.router.get_deployments() | |
| self.assertEqual(42, result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment