# Path: htmlgen/link.py
# class Link(Element):
#     """An HTML inline link (<a>) element.
# 
#         >>> link = Link("http://www.example.com/", "caption")
#         >>> link.append(", more")
#         >>> link.url
#         'http://www.example.com/'
#         >>> str(link)
#         '<a href="http://www.example.com/">caption, more</a>'
# 
#     By default links open in the same window. This can be influenced using
#     the target property:
# 
#         >>> link = Link("/foo/bar")
#         >>> link.target
#         '_self'
#         >>> link.set_blank_target()
#         >>> link.target
#         '_blank'
#         >>> link.target = "my-window"
#         >>> str(link)
#         '<a href="/foo/bar" target="my-window"></a>'
# 
#     Please refer to the HeadLink class for <link> elements.
#     """
# 
#     def __init__(self, url, *content):
#         super().__init__("a")
#         self.url = url
#         self.extend(content)
# 
#     url = html_attribute("href")
#     target = html_attribute("target", "_self")
#     title = html_attribute("title")
# 
#     def set_blank_target(self):
#         self.target = "_blank"


from unittest import TestCase
from asserts import assert_equal
from htmlgen.link import Link
            [
                b'<a href="foo">',
                b"initial",
                b"caption",
                b" continued",
                b"</a>",
            ],
            list(iter(link)),
        )

    def test_url(self):
        link = Link("initial-url")
        assert_equal("initial-url", link.url)
        link.url = "new-url"
        assert_equal([b'<a href="new-url">', b"</a>"], list(iter(link)))

    def test_target(self):
        link = Link("")
        assert_equal("_self", link.target)
        link.target = "my-target"
        assert_equal(
            [b'<a href="" target="my-target">', b"</a>"], list(iter(link))
        )
        link.set_blank_target()
        assert_equal("_blank", link.target)
        assert_equal(
            [b'<a href="" target="_blank">', b"</a>"], list(iter(link))
        )

    def test_title(self):

# Path: htmlgen/link.py
# class Link(Element):
#     """An HTML inline link (<a>) element.
# 
#         >>> link = Link("http://www.example.com/", "caption")
#         >>> link.append(", more")
#         >>> link.url
#         'http://www.example.com/'
#         >>> str(link)
#         '<a href="http://www.example.com/">caption, more</a>'
# 
#     By default links open in the same window. This can be influenced using
#     the target property:
# 
#         >>> link = Link("/foo/bar")
#         >>> link.target
#         '_self'
#         >>> link.set_blank_target()
#         >>> link.target
#         '_blank'
#         >>> link.target = "my-window"
#         >>> str(link)
#         '<a href="/foo/bar" target="my-window"></a>'
# 
#     Please refer to the HeadLink class for <link> elements.
#     """
# 
#     def __init__(self, url, *content):
#         super().__init__("a")
#         self.url = url
#         self.extend(content)
# 
#     url = html_attribute("href")
#     target = html_attribute("target", "_self")
#     title = html_attribute("title")
# 
#     def set_blank_target(self):
#         self.target = "_blank"


# Path: test_htmlgen/link.py
from unittest import TestCase
from asserts import assert_equal
from htmlgen.link import Link

            [
                b'<a href="foo">',
                b"initial",
                b"caption",
                b" continued",
                b"</a>",
            ],
            list(iter(link)),
        )

    def test_url(self):
        link = Link("initial-url")
        assert_equal("initial-url", link.url)
        link.url = "new-url"
        assert_equal([b'<a href="new-url">', b"</a>"], list(iter(link)))

    def test_target(self):
        link = Link("")
        assert_equal("_self", link.target)
        link.target = "my-target"
        assert_equal(
            [b'<a href="" target="my-target">', b"</a>"], list(iter(link))
        )
        link.set_blank_target()
        assert_equal("_blank", link.target)
        assert_equal(
            [b'<a href="" target="_blank">', b"</a>"], list(iter(link))
        )

    def test_title(self):

        link = Link("foo")