Example #1
0
    def test_convert_long_urls_leaves_hostname_for_root_path(self):
        text = convert_long_urls("text http://www.hostname.de text",
                                 "www.hostname.de")
        self.assertEqual(text, "text http://www.hostname.de text")

        text = convert_long_urls("text http://www.hostname.de/ text",
                                 "www.hostname.de")
        self.assertEqual(text, "text http://www.hostname.de/ text")
Example #2
0
    def test_convert_long_urls_removes_hostname_from_structure_node_path(self):
        text = convert_long_urls("text http://www.hostname.de/foo.1/ text",
                                 "www.hostname.de")
        self.assertEqual(text, "text /foo.1/ text")

        text = convert_long_urls("text https://www.hostname.de/foo.1 text",
                                 "www.hostname.de")
        self.assertEqual(text, "text /foo.1 text")
Example #3
0
    def test_convert_long_urls_removes_hostname_from_argument_path(self):
        text = convert_long_urls(
            "text http://www.hostname.de/foo.1/ba.2.con.7 text",
            "www.hostname.de")
        self.assertEqual(text, "text /foo.1/ba.2.con.7 text")

        text = convert_long_urls(
            "text http://www.hostname.de/foo.1/ba.2.con.7/ text",
            "www.hostname.de")
        self.assertEqual(text, "text /foo.1/ba.2.con.7/ text")
Example #4
0
 def test_convert_long_urls_converts_user_urls(self):
     text = convert_long_urls("text http://www.hostname.de/user/admin text",
                              "www.hostname.de")
     self.assertEqual(text, "text @admin text")
Example #5
0
 def test_convert_long_urls_leaves_hostname_for_non_node_path(self):
     text = convert_long_urls("text http://www.hostname.de/imprint text",
                              "www.hostname.de")
     self.assertEqual(text, "text http://www.hostname.de/imprint text")