Exemple #1
0
    def test_url_with_diffent_hostname_than_the_given_url_does_not_belong_to_same_domain(
            self):
        link = Link("http://www.friendpage.com",
                    "A link",
                    parent_url="http://www.apage.com")
        is_same_domain = link.is_same_domain("http://www.someotherpage.com")

        self.assertFalse(is_same_domain)
Exemple #2
0
    def test_url_having_same_hostname_as_the_given_url_belongs_to_same_domain(
            self):
        link = Link("http://www.friendpage.com",
                    "A link",
                    parent_url="http://www.apage.com")
        is_same_domain = link.is_same_domain("http://www.friendpage.com")

        self.assertTrue(is_same_domain)
Exemple #3
0
    def test_relative_url_with_different_parent_hostname_than_given_url_does_not_belong_to_same_domain(
            self):
        link = Link("/whatever", "A link", parent_url="http://www.apage.com")
        is_same_domain = link.is_same_domain("http://www.google.com")

        self.assertFalse(is_same_domain)
Exemple #4
0
    def test_relative_url_with_parent_hostname_same_as_given_url_belongs_to_same_domain(
            self):
        link = Link("/whatever", "A link", parent_url="http://www.apage.com")
        is_same_domain = link.is_same_domain("http://www.apage.com")

        self.assertTrue(is_same_domain)