def test_git_hg(self): self.assertEqual( cleanup_repo_url( 'hg::https://bitbucket.org/sumwars/sumwars-code' ), 'hg::https://bitbucket.org/sumwars/sumwars-code' )
def get_attribute(self, instance): if instance.linked_component: instance = instance.linked_component url = getattr(instance, self.source) if not settings.HIDE_REPO_CREDENTIALS: return url return cleanup_repo_url(url)
def get_repo_url(self): ''' Returns link to repository. ''' if self.is_repo_link: return self.linked_subproject.get_repo_url() if not HIDE_REPO_CREDENTIALS: return self.repo return cleanup_repo_url(self.repo)
def test_github(self): self.assertEqual( cleanup_repo_url('[email protected]:WeblateOrg/weblate.git'), '[email protected]:WeblateOrg/weblate.git', )
def test_git(self): self.assertEqual( cleanup_repo_url('git://git.weblate.org/weblate.git'), 'git://git.weblate.org/weblate.git', )
def test_http_user(self): self.assertEqual( cleanup_repo_url('http://[email protected]'), 'http://example.com', )
def get_attribute(self, instance): url = super().get_attribute(instance) if not settings.HIDE_REPO_CREDENTIALS: return url return cleanup_repo_url(url)
def test_github(self): self.assertEqual( cleanup_repo_url("[email protected]:WeblateOrg/weblate.git"), "[email protected]:WeblateOrg/weblate.git", )
def test_git(self): self.assertEqual( cleanup_repo_url("git://git.weblate.org/weblate.git"), "git://git.weblate.org/weblate.git", )
def test_http(self): self.assertEqual(cleanup_repo_url("http://*****:*****@example.com"), "http://example.com")