コード例 #1
0
ファイル: link_tests.py プロジェクト: abyu/sitecrawler
    def test_absolute_url_not_same_as_the_given_url(self):
        link = Link("http://www.another.com/microsite",
                    "A link",
                    parent_url="")
        has_same_parent = link.has_same_parent("http://www.apage.com/")

        self.assertFalse(has_same_parent)
コード例 #2
0
ファイル: link_tests.py プロジェクト: abyu/sitecrawler
    def test_url_does_not_have_same_parent_path_as_the_given_url(self):
        link = Link("/microsite/about",
                    "A link",
                    parent_url="http://www.apage.com")
        has_same_parent = link.has_same_parent(
            "http://www.apage.com/anothermicrosite")

        self.assertFalse(has_same_parent)
コード例 #3
0
ファイル: link_tests.py プロジェクト: abyu/sitecrawler
    def test_url_with_deeper_path_has_parent_path_as_the_given_url(self):
        link = Link("/microsite/blog/anotherplace/about/specific",
                    "A link",
                    parent_url="http://www.apage.com")
        has_same_parent = link.has_same_parent(
            "http://www.apage.com/microsite")

        self.assertTrue(has_same_parent)
コード例 #4
0
ファイル: link_tests.py プロジェクト: abyu/sitecrawler
    def test_url_has_parent_path_as_the_given_url(self):
        link = Link("/microsite/about",
                    "A link",
                    parent_url="http://www.apage.com")
        has_same_parent = link.has_same_parent(
            "http://www.apage.com/microsite")

        self.assertTrue(has_same_parent)