Example #1
0
 def test_pip_install_package_for_unknown_package(self):
     response = pip_install_package('doesnotexist', self.tempdir)
     self.assertNotIn(
         'doesnotexist',
         os.listdir(os.path.join(self.tempdir, 'bin'))
     )
     self.assertEqual(response, 'could not install')
Example #2
0
 def test_pip_install_package_for_known_package(self):
     response = pip_install_package('virtualenvify', self.tempdir)
     self.assertIn(
         'virtualenvify.py',
         os.listdir(os.path.join(self.tempdir, 'bin'))
     )
     self.assertEqual(response, 'installed successfully')
Example #3
0
 def test_pip_install_package_with_copy_local_option_and_single_file_package(self):
     response = pip_install_package('argparse', self.tempdir, copy_local=True)
     self.assertIn(
         'argparse.py',
         os.listdir(
             os.path.join(self.tempdir, 'lib', 'python2.7', 'site-packages')
         )
     )
     self.assertEqual(response, 'copied from existing installation')
Example #4
0
 def test_pip_install_package_for_compilation_required_falls_back_to_copying_our_version(self):
     response = pip_install_package('fiona', self.tempdir)
     self.assertIn(
         'fiona',
         os.listdir(
             os.path.join(self.tempdir, 'lib', 'python2.7', 'site-packages')
         )
     )
     self.assertEqual(response, 'copied from existing installation')
     _, path_to_our_version, __ = imp.find_module('fiona')
     for filename in os.listdir(path_to_our_version):
         if filename.endswith('.py') or filename.endswith('.so'):
             self.assertTrue(os.path.exists(
                 os.path.join(self.tempdir, 'lib', 'python2.7', 'site-packages', 'fiona', filename)
             ))