Exemplo n.º 1
0
 def test_local_windows(self):
     self.assertEqual(
         'file:///c:/srv/git/PROJECT',
         SCMBase._remove_credentials_url('file:///c:/srv/git/PROJECT'))
     self.assertEqual(
         'file:///C:/srv/git/PROJECT',
         SCMBase._remove_credentials_url('file:///C:/srv/git/PROJECT'))
Exemplo n.º 2
0
 def test_local_unix(self):
     self.assertEqual(
         'file:///srv/git/project.git',
         SCMBase._remove_credentials_url('file:///srv/git/project.git'))
     self.assertEqual(
         'file:///srv/git/PROJECT.git',
         SCMBase._remove_credentials_url('file:///srv/git/PROJECT.git'))
Exemplo n.º 3
0
 def test_ssh(self):
     # Here, for ssh, we don't want to remove the user ('git' in this example)
     # URL-like syntax
     self.assertEqual('ssh://[email protected]:2222/conan-io/conan.git',
                      SCMBase._remove_credentials_url(
                          'ssh://[email protected]:2222/conan-io/conan.git'))
     # URL-like syntax with a password
     self.assertEqual('ssh://[email protected]:2222/conan-io/conan.git',
                      SCMBase._remove_credentials_url(
                          'ssh://*****:*****@github.com:2222/conan-io/conan.git'))
     self.assertEqual('ssh://github.com:2222/conan-io/conan.git',
                      SCMBase._remove_credentials_url(
                          'ssh://github.com:2222/conan-io/conan.git'))
     # scp-like syntax
     self.assertEqual('[email protected]:conan-io/conan.git',
                      SCMBase._remove_credentials_url(
                          '[email protected]:conan-io/conan.git'))
Exemplo n.º 4
0
    def test_http(self):
        expected_url = 'https://myrepo.com/path/to/repo.git'
        test_urls = ['https://myrepo.com/path/to/repo.git',
                     'https://*****:*****@myrepo.com/path/to/repo.git',
                     'https://[email protected]/path/to/repo.git',
                     'https://*****:*****@myrepo.com/path/to/repo.git',
                     ]

        for it in test_urls:
            self.assertEqual(expected_url, SCMBase._remove_credentials_url(it))
Exemplo n.º 5
0
 def test_svn_ssh(self):
     self.assertEqual('svn+ssh://10.106.191.164/home/svn/shproject',
                      SCMBase._remove_credentials_url(
                          'svn+ssh://username:[email protected]/home/svn/shproject'))
Exemplo n.º 6
0
 def test_http_with_port_number(self):
     self.assertEqual('https://myrepo.com:8000/path/to/repo.git',
                      SCMBase._remove_credentials_url(
                          'https://[email protected]:8000/path/to/repo.git'))
Exemplo n.º 7
0
 def test_ssh(self):
     # Here, for ssh, we don't want to remove the user ('git' in this example)
     self.assertEqual('[email protected]:conan-io/conan.git',
                      SCMBase._remove_credentials_url(
                          '[email protected]:conan-io/conan.git'))