This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
/
test_setup_folder.py
69 lines (57 loc) · 1.72 KB
/
test_setup_folder.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# -*- coding: utf-8 -*-
"""
@brief test log(time=25s)
"""
import sys
import os
import unittest
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..")))
if path not in sys.path:
sys.path.append(path)
import src
try:
import pyquickhelper as skip_
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..",
"..",
"pyquickhelper",
"src")))
if path not in sys.path:
sys.path.append(path)
if "PYQUICKHELPER" in os.environ and len(os.environ["PYQUICKHELPER"]) > 0:
sys.path.append(os.environ["PYQUICKHELPER"])
import pyquickhelper as skip_
from src.pymyinstall.setuphelper import create_folder_setup
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, ExtTestCase
class TestSetupFolder(ExtTestCase):
def test_setup_folder(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_setup_folder", clean=False)
import pandas
self.assertTrue(pandas is not None)
st = create_folder_setup('pandas', fLOG=fLOG, output_path=temp)
self.assertEqual(len(st), 1)
self.assertExists(st[0])
exp = os.path.join(temp, 'dist')
found = os.listdir(exp)
self.assertEqual(len(found), 1)
self.assertIn(".whl", found[0])
if __name__ == "__main__":
unittest.main()