Ejemplo n.º 1
0
 def download_one(request):
     """
     Mock the download_one() method to manipulate the path.
     """
     self.assertEqual(request.url, 'https://registry.example.com/v2/pulp/tags/list')
     self.assertEqual(type(request.destination), type(StringIO()))
     report = DownloadReport(request.url, request.destination)
     report.download_succeeded()
     report.headers = {}
     report.destination.write('{"name": "pulp", "tags": ["best_ever", "latest", "decent"]}')
     return report
Ejemplo n.º 2
0
 def download_one(request):
     """
     Mock the download_one() method.
     """
     self.assertEqual(request.url, 'https://registry.example.com/some/path')
     self.assertEqual(type(request.destination), type(StringIO()))
     report = DownloadReport(request.url, request.destination)
     report.download_succeeded()
     report.headers = {'some': 'cool stuff'}
     report.destination.write("This is the stuff you've been waiting for.")
     return report
Ejemplo n.º 3
0
 def download_one(request):
     """
     Mock the download_one() method to manipulate the path.
     """
     self.assertEqual(request.url, 'https://registry.example.com/v2/')
     self.assertEqual(type(request.destination), type(StringIO()))
     report = DownloadReport(request.url, request.destination)
     report.download_succeeded()
     report.headers = {'Docker-Distribution-API-Version': 'registry/2.0'}
     report.destination.write("")
     return report
Ejemplo n.º 4
0
 def download_one(request):
     """
     Mock the download_one() method.
     """
     self.assertEqual(request.url, 'https://registry.example.com/some/path')
     self.assertEqual(type(request.destination), type(StringIO()))
     report = DownloadReport(request.url, request.destination)
     report.download_succeeded()
     report.headers = {'some': 'cool stuff'}
     report.destination.write("This is the stuff you've been waiting for.")
     return report
Ejemplo n.º 5
0
 def download_one(request):
     """
     Mock the download_one() method to manipulate the path.
     """
     self.assertEqual(request.url, 'https://registry.example.com/v2/pulp/tags/list')
     self.assertEqual(type(request.destination), type(StringIO()))
     report = DownloadReport(request.url, request.destination)
     report.download_succeeded()
     report.headers = {}
     report.destination.write('{"name": "pulp", "tags": ["best_ever", "latest", "decent"]}')
     return report
Ejemplo n.º 6
0
 def download_one(request):
     """
     Mock the download_one() method to manipulate the path.
     """
     self.assertEqual(request.url, 'https://registry.example.com/v2/')
     self.assertEqual(type(request.destination), type(StringIO()))
     report = DownloadReport(request.url, request.destination)
     report.download_succeeded()
     report.headers = {'Docker-Distribution-API-Version': 'registry/2.0'}
     report.destination.write("")
     return report
Ejemplo n.º 7
0
 def download_one(request):
     """
     Mock the download_one() method to manipulate the path.
     """
     self.assertEqual(request.url, 'https://registry.example.com/v2/')
     self.assertEqual(type(request.destination), type(StringIO()))
     report = DownloadReport(request.url, request.destination)
     report.download_succeeded()
     # The Version header is not present
     report.headers = {}
     report.destination.write("")
     return report
Ejemplo n.º 8
0
 def download_one(request):
     """
     Mock the download_one() method to manipulate the path.
     """
     self.assertEqual(request.url, 'https://registry.example.com/v2/')
     self.assertEqual(type(request.destination), type(StringIO()))
     report = DownloadReport(request.url, request.destination)
     report.download_succeeded()
     # The Version header is not present
     report.headers = {}
     report.destination.write("")
     return report
Ejemplo n.º 9
0
 def download_one(request):
     """
     Mock the download_one() method to manipulate the path.
     """
     self.assertEqual(request.url,
                      'https://registry.example.com/v2/pulp/manifests/best_version_ever')
     self.assertEqual(type(request.destination), type(StringIO()))
     report = DownloadReport(request.url, request.destination)
     report.download_succeeded()
     schema2 = 'application/vnd.docker.distribution.manifest.v2+json'
     report.headers = {'Docker-Distribution-API-Version': 'registry/2.0',
                       'docker-content-digest': digest,
                       'content-type': schema2}
     report.destination.write(manifest)
     return report