Ejemplo n.º 1
0
 def test_mount(self):
     fn = os.path.join(HERE, 'dummy-0.1-py27-none-any.whl')
     w = Wheel(fn)
     self.assertNotIn(fn, sys.path)
     w.mount()
     self.assertIn(fn, sys.path)
     w.unmount()
     self.assertNotIn(fn, sys.path)
Ejemplo n.º 2
0
 def test_mount(self):
     fn = os.path.join(HERE, 'dummy-0.1-py27-none-any.whl')
     w = Wheel(fn)
     self.assertNotIn(fn, sys.path)
     w.mount()
     self.assertIn(fn, sys.path)
     w.unmount()
     self.assertNotIn(fn, sys.path)
Ejemplo n.º 3
0
 def test_mount_extensions(self):
     if PYVER == 'py27':
         fn = 'minimext-0.1-cp27-none-linux_x86_64.whl'
     elif PYVER == 'py32':
         fn = 'minimext-0.1-cp32-cp32mu-linux_x86_64.whl'
     elif PYVER == 'py33':
         fn = 'minimext-0.1-cp33-cp33m-linux_x86_64.whl'
     else:
         fn = None
     if not fn:  # pragma: no cover
         raise unittest.SkipTest('Suitable wheel not found.')
     fn = os.path.join(HERE, fn)
     w = Wheel(fn)
     if not w.is_compatible() or not w.is_mountable():  # pragma: no cover
         raise unittest.SkipTest('Wheel not suitable for mounting.')
     self.assertRaises(ImportError, __import__, 'minimext')
     w.mount()
     mod = __import__('minimext')
     self.assertIs(mod, sys.modules['minimext'])
     self.assertEqual(mod.fib(10), 55)
     w.unmount()
     del sys.modules['minimext']
     self.assertRaises(ImportError, __import__, 'minimext')
Ejemplo n.º 4
0
 def test_mount_extensions(self):
     if PYVER == 'py27':
         fn = 'minimext-0.1-cp27-none-linux_x86_64.whl'
     elif PYVER == 'py32':
         fn = 'minimext-0.1-cp32-cp32mu-linux_x86_64.whl'
     elif PYVER == 'py33':
         fn = 'minimext-0.1-cp33-cp33m-linux_x86_64.whl'
     else:
         fn = None
     if not fn:      # pragma: no cover
         raise unittest.SkipTest('Suitable wheel not found.')
     fn = os.path.join(HERE, fn)
     w = Wheel(fn)
     if not is_compatible(w):    # pragma: no cover
         raise unittest.SkipTest('Wheel not suitable for mounting.')
     self.assertRaises(ImportError, __import__, 'minimext')
     w.mount()
     mod = __import__('minimext')
     self.assertIs(mod, sys.modules['minimext'])
     self.assertEqual(mod.fib(10), 55)
     w.unmount()
     del sys.modules['minimext']
     self.assertRaises(ImportError, __import__, 'minimext')
Ejemplo n.º 5
0
 def test_mount_extensions(self):
     if PYVER == "py27":
         fn = "minimext-0.1-cp27-none-linux_x86_64.whl"
     elif PYVER == "py32":
         fn = "minimext-0.1-cp32-cp32mu-linux_x86_64.whl"
     elif PYVER == "py33":
         fn = "minimext-0.1-cp33-cp33m-linux_x86_64.whl"
     else:
         fn = None
     if not fn:  # pragma: no cover
         raise unittest.SkipTest("Suitable wheel not found.")
     fn = os.path.join(HERE, fn)
     w = Wheel(fn)
     if not w.is_compatible() or not w.is_mountable():  # pragma: no cover
         raise unittest.SkipTest("Wheel not suitable for mounting.")
     self.assertRaises(ImportError, __import__, "minimext")
     w.mount()
     mod = __import__("minimext")
     self.assertIs(mod, sys.modules["minimext"])
     self.assertEqual(mod.fib(10), 55)
     w.unmount()
     del sys.modules["minimext"]
     self.assertRaises(ImportError, __import__, "minimext")