예제 #1
0
 def test_hello(self):
     friend_name = "Pepe"
     assert hello(friend_name) == "Hello, %s!" % friend_name
예제 #2
0
 def test_hello(self):
     self.assertTrue("Hello" in hello("Bob"))
예제 #3
0
 def test_hello_no_arg(self):
     self.assertTrue("Hello" in hello())
예제 #4
0
 def test_hello(self):
     self.assertEqual(hello('Mihai'), 'Hello, Mihai!')
예제 #5
0
    def test_hello_outputs_correct_name(self):
        result = hello('John')

        self.assertEqual('Hello, John!', result)
예제 #6
0
 def test_hello(self):
     self.assertEqual(hello("John"), "Hello, John!")
     self.assertEqual(hello(""), "Hello, !")
예제 #7
0
 def test_hello_return_type(self):
     self.assertTrue(isinstance(hello("world"), str))
예제 #8
0
def test_hello(friend, expected):
    h = hello(friend)
    assert h == "Hello, {}!".format(expected)