예제 #1
0
 def test_pkginfo_from_no_ext(self):
     """
     .pkginfo_from_file with no extension
     """
     from cheeseprism.index import IndexManager
     with self.assertRaises(RuntimeError):
         IndexManager.pkginfo_from_file('adfasdkfha')
예제 #2
0
 def test_pkginfo_from_bad_ext(self):
     """
     .pkginfo_from_file with unrecognized extension
     """
     from cheeseprism.index import IndexManager
     with self.assertRaises(RuntimeError):
         IndexManager.pkginfo_from_file('adfasdkfha.adkfhalsdk')
예제 #3
0
 def test_pkginfo_from_bad_ext(self):
     """
     .pkginfo_from_file with unrecognized extension
     """
     from cheeseprism.index import IndexManager
     with self.assertRaises(RuntimeError):
         IndexManager.pkginfo_from_file('adfasdkfha.adkfhalsdk')
예제 #4
0
 def test_pkginfo_from_no_ext(self):
     """
     .pkginfo_from_file with no extension
     """
     from cheeseprism.index import IndexManager
     with self.assertRaises(RuntimeError):
         IndexManager.pkginfo_from_file('adfasdkfha')
예제 #5
0
 def test_pkginfo_from_file_exc(self):
     """
     .pkginfo_from_file with exception and no handler
     """
     from cheeseprism.index import IndexManager
     exc = ValueError("BOOM")
     with patch('pkginfo.bdist.BDist', side_effect=exc):
         IndexManager.pkginfo_from_file('bad.egg')
예제 #6
0
 def test_pkginfo_from_file_exc(self):
     """
     .pkginfo_from_file with exception and no handler
     """
     from cheeseprism.index import IndexManager
     exc = ValueError("BOOM")
     with patch('pkginfo.bdist.BDist', side_effect=exc):
         IndexManager.pkginfo_from_file('bad.egg')
예제 #7
0
 def test_pkginfo_from_bad_ext_handled(self):
     """
     .pkginfo_from_file with unrecognized extension
     """
     from cheeseprism.index import IndexManager
     handler = Mock(name='handler')
     IndexManager.pkginfo_from_file('adfasdkfha.adkfhalsdk', handle_error=handler)
     assert handler.call_args[0][1] == 'adfasdkfha.adkfhalsdk'
     assert isinstance(handler.call_args[0][0], RuntimeError)
예제 #8
0
 def test_pkginfo_from_bad_ext_handled(self):
     """
     .pkginfo_from_file with unrecognized extension
     """
     from cheeseprism.index import IndexManager
     handler = Mock(name='handler')
     IndexManager.pkginfo_from_file('adfasdkfha.adkfhalsdk',
                                    handle_error=handler)
     assert handler.call_args[0][1] == 'adfasdkfha.adkfhalsdk'
     assert isinstance(handler.call_args[0][0], RuntimeError)
예제 #9
0
 def test_pkginfo_from_file_exc_and_handler(self):
     """
     .pkginfo_from_file with exception and handler
     """
     from cheeseprism.index import IndexManager
     exc = Exception("BOOM")
     with patch('pkginfo.bdist.BDist', side_effect=exc):
         eh = Mock(name='error_handler')
         IndexManager.pkginfo_from_file('bad.egg', handle_error=eh)
     assert eh.called
     assert eh.call_args[0] == (exc, 'bad.egg'), eh.call_args[0]
예제 #10
0
 def test_pkginfo_from_file_exc_and_handler(self):
     """
     .pkginfo_from_file with exception and handler
     """
     from cheeseprism.index import IndexManager
     exc = Exception("BOOM")
     with patch('pkginfo.bdist.BDist', side_effect=exc):
         eh = Mock(name='error_handler')
         IndexManager.pkginfo_from_file('bad.egg', handle_error=eh)
     assert eh.called
     assert eh.call_args[0] == (exc, 'bad.egg'), eh.call_args[0]
예제 #11
0
 def test_pkginfo_from_file_sdist(self):
     """
     .pkginfo_from_file: sdist
     """        
     from cheeseprism.index import IndexManager
     for ext in ('.gz','.tgz', '.bz2', '.zip'):
         assert IndexManager.pkginfo_from_file('blah.%s' %ext) is True
예제 #12
0
 def test_pkginfo_from_file_whl(self):
     """
     .pkginfo_from_file: wheel
     """
     from cheeseprism.index import IndexManager
     with patch('pkginfo.wheel.Wheel', new=Mock(return_value=True)):
         assert IndexManager.pkginfo_from_file('blah.whl') is True
예제 #13
0
 def test_pkginfo_from_file_whl(self):
     """
     .pkginfo_from_file: wheel
     """
     from cheeseprism.index import IndexManager
     with patch('pkginfo.wheel.Wheel', new=Mock(return_value=True)):
         assert IndexManager.pkginfo_from_file('blah.whl') is True
예제 #14
0
 def test_pkginfo_from_file_sdist(self):
     """
     .pkginfo_from_file: sdist
     """
     from cheeseprism.index import IndexManager
     for ext in ('.gz', '.tgz', '.bz2', '.zip'):
         assert IndexManager.pkginfo_from_file('blah.%s' % ext) is True
예제 #15
0
 def test_pkginfo_from_no_ext(self):
     """
     .pkginfo_from_file with no extension
     """
     from cheeseprism.index import IndexManager
     IndexManager.pkginfo_from_file('adfasdkfha')        
예제 #16
0
 def test_pkginfo_from_bad_ext(self):
     """
     .pkginfo_from_file with unrecognized extension
     """
     from cheeseprism.index import IndexManager
     IndexManager.pkginfo_from_file('adfasdkfha.adkfhalsdk')
예제 #17
0
 def test_pkginfo_from_no_ext(self):
     """
     .pkginfo_from_file with no extension
     """
     from cheeseprism.index import IndexManager
     IndexManager.pkginfo_from_file('adfasdkfha')
예제 #18
0
 def test_pkginfo_from_bad_ext(self):
     """
     .pkginfo_from_file with unrecognized extension
     """
     from cheeseprism.index import IndexManager
     IndexManager.pkginfo_from_file('adfasdkfha.adkfhalsdk')
예제 #19
0
 def test_pkginfo_from_file_egg(self):
     """
     .pkginfo_from_file: bdist
     """
     from cheeseprism.index import IndexManager
     assert IndexManager.pkginfo_from_file('blah.egg') is True
예제 #20
0
 def test_pkginfo_from_no_ext(self):
     from cheeseprism.index import IndexManager
     IndexManager.pkginfo_from_file('adfasdkfha')        
예제 #21
0
 def test_pkginfo_from_file_egg(self):
     from cheeseprism.index import IndexManager
     assert IndexManager.pkginfo_from_file('blah.egg') is True