def test_root_on_root(self): """ root_url pessimistic on root """ root_url = "root/" path = "/" expected = "/root" rooted_url = rooted_path(root_url, path) self.assertEqual(expected, rooted_url)
def test_root_url_with_slash_in_front(self): """ Happy scenario too, root_url with slash in front """ root_url = "/root" path = "/ext" expected = "/root/ext" rooted_url = rooted_path(root_url, path) self.assertEqual(expected, rooted_url)
def test_root_url_no_slash(self): """ root_url with no slash """ root_url = "root" path = "/ext" expected = "/root/ext" rooted_url = rooted_path(root_url, path) self.assertEqual(expected, rooted_url)
def test_root_url_with_slash_in_front_and_back(self): """ Happy scenario, root_url with slash back to back """ root_url = "/root/" path = "/ext" expected = "/root/ext" rooted_url = rooted_path(root_url, path) self.assertEqual(expected, rooted_url)