Пример #1
0
    def test_get_url_returns_include_parent_base_url_for_a_relative_url(self):
        link = Link("/something",
                    "A link",
                    parent_url="http://www.apage.com/someplace/whatever")

        url = link.get_url()

        self.assertEquals("http://www.apage.com/something", url)
Пример #2
0
    def test_get_url_strips_any_trailing_slash(self):
        link = Link("http://thisurl.com/", "A link", parent_url="")

        url = link.get_url()

        self.assertEquals("http://thisurl.com", url)
Пример #3
0
    def test_get_url_strips_any_trailing_slash_for_relative_url(self):
        link = Link("/something/", "A link", parent_url="http://www.apage.com")

        url = link.get_url()

        self.assertEquals("http://www.apage.com/something", url)
Пример #4
0
    def test_get_url_returns_the_url_string(self):
        link = Link("http://thisurl.com", "A link", parent_url="")

        url = link.get_url()

        self.assertEquals("http://thisurl.com", url)