浏览代码

Test extracting files from a wheel

Thomas Kluyver 9 年之前
父节点
当前提交
9dbdb3f200
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      nsist/tests/test_pypi.py

+ 8 - 2
nsist/tests/test_pypi.py

@@ -1,13 +1,19 @@
 from nose.tools import *
-from testpath import assert_isfile
+from os.path import join as pjoin
+from testpath import assert_isfile, assert_isdir
+from testpath.tempdir import TemporaryDirectory
 
-from nsist.pypi import WheelDownloader, CachedRelease
+from nsist.pypi import WheelDownloader, extract_wheel, CachedRelease
 
 def test_download():
     wd = WheelDownloader("astsearch==0.1.2", "3.5.1", 64)
     wheel = wd.fetch()
     assert_isfile(wheel)
 
+    with TemporaryDirectory() as td:
+        extract_wheel(wheel, target_dir=td)
+        assert_isfile(pjoin(td, 'astsearch.py'))
+
 # To exclude this, run:  nosetests -a '!network'
 test_download.network = 1