示例#1
0
class TestHelloPart(unittest.TestCase):

    def setUp(self):
        self.c = HelloPart('block', MagicMock())

    def test_say_hello(self):
        expected = "Hello test_name"

        parameters_mock = Mock()
        parameters_mock.name = "test_name"
        parameters_mock.sleep = 0
        returns_mock = Mock()
        response = self.c.greet(parameters_mock, returns_mock)
        self.assertEquals(expected, response.greeting)
示例#2
0
 def setUp(self):
     self.c = HelloPart('block', MagicMock())