[Coding Training Python] 연습문제 3. 따옴표 출력

연습문제 3. 따옴표 출력

출력 예

What is the quote? These aren't the droids you're looking for
Who said it? Obi-Wan Kenobi
Obi-Wan Kenobi says, "These aren't the droids you're looking for."

제약 조건

도전 과제


import unittest
from unittest.mock import patch, Mock


def input_name():
    return input('Who said it? ')


def input_quote():
    return input('What is the quote? ')


def print_double_quote():
    return f"{input_name()} says, \"{input_quote()}\""
    

class TestDoubleQuote(unittest.TestCase):
    
    @patch('no_3.input_name', Mock(return_value='THKwon'))
    @patch('no_3.input_quote', Mock(return_value='Do code so hard.'))
    def test_print_double_quote(self):
        self.assertEqual(print_double_quote(), "THKwon says, \"Do code so hard.\"")


회고