示例#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)