def test_generate_tag_with_empty_content(self): _type = 'body' name = 'Every day' content = [] expected_output = textwrap.dedent("""\ <body class="Every day"> </body>""") self.assertEqual(generate_tag(_type, name, content), expected_output)
def test_generate_tag_with_simple_content(self): _type = 'body' name = 'Every day' content = ['eating', 'sleaping', 'programing'] expected_output = textwrap.dedent("""\ <body class="Every day"> eating sleaping programing </body>""") self.assertEqual(generate_tag(_type, name, content), expected_output)
def test_test_generate_tag_with_empty_name(self): _type = 'body' name = '' content = ['eating', 'sleaping', 'programing'] expected_output = textwrap.dedent("""\ <body> eating sleaping programing </body>""") self.assertEqual(generate_tag(_type, name, content), expected_output)
def test_generate_tag_with_complex_content(self): sub_tage_type = 'body' sub_tag_name = 'Every day' sub_tag_ontent = ['eating', 'sleaping', 'programing'] sub_tag = generate_tag(sub_tage_type, sub_tag_name, sub_tag_ontent) tag_type = 'div' tag_name = 'Anton' tag_content = ['Hack Bulgaria', 'Python', sub_tag] expected_output = textwrap.dedent("""\ <div class="Anton"> Hack Bulgaria Python <body class="Every day"> eating sleaping programing </body> </div>""") self.assertEqual(generate_tag(tag_type, tag_name, tag_content), expected_output)