Esempio n. 1
0
    def setUp(self):
        greeter = Stub('greeter')
        calling(greeter).passing('the name').returns('the greeting')

        self.controller = GreetingController(greeter)
        self.request = Stub('request', kwargs={'name': 'the name'})
        self.response = Mock('response')
Esempio n. 2
0
    def setUp(self):
        # use stubs to provide canned responses to queries:
        prompter = Stub()
        calling(prompter).passing('First name:').returns('Justin')
        calling(prompter).passing('Last name:').returns('Blake')

        # use mocks to verify commands:
        self.printer = Mock()

        self.greeter = Greeter(prompter, self.printer)
Esempio n. 3
0
    def setUp(self):
        # use stubs to provide canned responses to queries:
        prompter = Stub()
        calling(prompter).passing("First name:").returns("Justin")
        calling(prompter).passing("Last name:").returns("Blake")

        # use mocks to verify commands:
        self.printer = Mock()

        self.greeter = Greeter(prompter, self.printer)
Esempio n. 4
0
File: tests.py Progetto: blaix/tdubs
    def setUp(self):
        # use stubs to provide canned responses to queries:
        prompter = Stub()
        calling(prompter).passing('First name:').returns('Justin')
        calling(prompter).passing('Last name:').returns('Blake')

        # use spies to verify commands:
        self.printer = Spy()

        self.greeter = Greeter(prompter, self.printer)
Esempio n. 5
0
    def setUp(self):
        super(TestRouterCall, self).setUp()

        self.environ = {'PATH_INFO': '/path'}
        start_response = Stub('start_response')

        route = Stub('route', kwargs={'expected': 'kwargs'})
        calling(route.endpoint).passing(self.environ, start_response).returns(
            'endpoint response')

        calling(self.routes.get).passing('/path').returns(route)

        self.response = self.router(self.environ, start_response)