Esempio n. 1
0
 def test_good_escapes(self):
     url = 'https://unscrupulous.com/Username%20With%20Spaces/good%40example.com.git'
     r = Repository(url)
     self.assertEqual(r.url, url)
     self.assertEqual(r.get_repository_argument(), url)
     self.assertEqual(r.scheme, 'https')
     self.assertEqual(r.host, 'unscrupulous.com')
     self.assertEqual(r.decoded_path_prefix(), 'Username With Spaces')
     self.assertEqual(r.decoded_repo_name(), '*****@*****.**')
Esempio n. 2
0
 def test_good_bundle_file_escapes(self):
     filepath = '/home/josephine/My Projects/my-project.bundle'
     url = pathlib.PurePath(filepath).as_uri()
     r = Repository(url)
     self.assertEqual(r.url, url)
     self.assertEqual(r.get_repository_argument(), filepath)
     self.assertEqual(r.scheme, 'file')
     self.assertEqual(r.host, '_filesystem')
     self.assertEqual(r.decoded_path_prefix(),
                      os.path.dirname(filepath).lstrip('/'), "path_prefix")
     self.assertEqual(r.decoded_repo_name(), 'my-project.bundle')
Esempio n. 3
0
 def test_decoded_path_prefix(self):
     url = 'https://somewhere.else/hello%40world/test-child-repo-1.git'
     r = Repository(url)
     self.assertEqual(r.decoded_path_prefix(), "hello@world")