Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)

src/m/o/mox3-0.7.0/mox3/tests/test_mox.py   mox3(Download)
    def testAndReturnNoneByDefault(self):
        """Should return None by default."""
        return_value = self.mock_method(['original'])
        self.assertTrue(return_value is None)
 
    def testAndReturnValue(self):
        """Should return a specificed return value."""
        expected_return_value = "test"
        self.expected_method.AndReturn(expected_return_value)
        return_value = self.mock_method(['original'])
 
        self.expected_method.WithSideEffects(modifier).AndReturn(1)
        self.mock_method(local_list)
        self.assertEqual('mutation', local_list[0])
 
 
        self.expected_method.WithSideEffects(modifier_with_return)
        actual_return = self.mock_method(local_list)
        self.assertEqual('mutation', local_list[0])
        self.assertEqual(expected_return, actual_return)
        self.expected_method.WithSideEffects(modifier_with_return).AndReturn(
            expected_return)
        actual_return = self.mock_method(local_list)
        self.assertEqual('mutation', local_list[0])
        self.assertEqual(expected_return, actual_return)