Ejemplo n.º 1
0
  def test_https_uri(self):
    install_list = install.get_install_list(
      ['https://some.host.com/some_package.whl'])

    self.assertEqual(len(install_list), 1)
    self.assertEqual(install_list[0]['location_type'], 'http')
    self.assertTrue(install_list[0]['location'].startswith('https://'))
Ejemplo n.º 2
0
  def test_gs_uri(self):
    install_list = install.get_install_list(
      ['gs://some_bucket/some_package.whl'])

    self.assertEqual(len(install_list), 1)
    self.assertEqual(install_list[0]['location_type'], 'http')
    self.assertEqual(
      install_list[0]['location'],
      'https://storage.googleapis.com/some_bucket/some_package.whl')
Ejemplo n.º 3
0
  def test_one_file(self):
    install_list = install.get_install_list([
      os.path.join(DATA_DIR, 'wheels', 'source_package_valid_sha1-0.0.1-0_'
                   '41128a9c3767ced3ec53b89b297e0268f1338b2b-py2-none-any.whl')
      ])

    self.assertEqual(len(install_list), 1)
    self.assertEqual(install_list[0]['location_type'], 'file')
    self.assertTrue(install_list[0]['location'].startswith('file://'))
Ejemplo n.º 4
0
 def test_existing_and_non_existing_files(self):
   install_list = install.get_install_list([
       os.path.join(DATA_DIR, 'wheels', 'source_package_valid_sha1-0.0.1-0_'
                  '41128a9c3767ced3ec53b89b297e0268f1338b2b-py2-none-any.whl'),
       os.path.join(
         DATA_DIR, 'wheels', 'non_existing_file-0.0.1-0_'
             '41128a9c3767ced3ec53b89b297e0268f1338b2b-py2-none-any.whl')
     ])
   self.assertTrue(len(install_list), 2)
   self.assertFalse(install_list[0].get('error'))
   self.assertTrue(install_list[1].get('error'))
Ejemplo n.º 5
0
 def test_unknown_uri(self):
   install_list = install.get_install_list(
     ['weird://some.host.com/some_package.whl'])
   self.assertTrue(len(install_list), 1)
   self.assertTrue(install_list[0].get('error'))