def test_validate_when_relative(self): self.version._url = "/root/publication/file" self.assertTrue(link_upgrader.validate(self.version)) self.version._url = "publication/file" self.assertTrue(link_upgrader.validate(self.version))
def test_not_validate_absolute_link_spaces(self): """An absolute URL should not validate, even if there are spaces before or after it. """ self.version._url = " http://www.google.com/" self.assertFalse(link_upgrader.validate(self.version))
def test_not_validate_relative_set(self): """If the link is already convert, it should not validate (there is already _relative set). """ self.version._relative = False self.assertFalse(link_upgrader.validate(self.version))
def test_not_validate_absolute_link(self): self.version._url = "http://www.google.com/" self.assertFalse(link_upgrader.validate(self.version))