Browse Source

Test extracting files from a wheel

Thomas Kluyver 9 năm trước cách đây
mục cha
commit
9dbdb3f200
1 tập tin đã thay đổi với 8 bổ sung2 xóa
  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